aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/--repository.rb8
-rw-r--r--Library/Homebrew/manpages/brew.1.md3
-rw-r--r--Library/Homebrew/test/test_integration_cmds.rb5
3 files changed, 15 insertions, 1 deletions
diff --git a/Library/Homebrew/cmd/--repository.rb b/Library/Homebrew/cmd/--repository.rb
index e2a5feb13..b697b3eaa 100644
--- a/Library/Homebrew/cmd/--repository.rb
+++ b/Library/Homebrew/cmd/--repository.rb
@@ -1,5 +1,11 @@
+require "tap"
+
module Homebrew
def __repository
- puts HOMEBREW_REPOSITORY
+ if ARGV.named.empty?
+ puts HOMEBREW_REPOSITORY
+ else
+ puts ARGV.named.map { |tap| Tap.fetch(tap).path }
+ end
end
end
diff --git a/Library/Homebrew/manpages/brew.1.md b/Library/Homebrew/manpages/brew.1.md
index d884d6702..aa88b373d 100644
--- a/Library/Homebrew/manpages/brew.1.md
+++ b/Library/Homebrew/manpages/brew.1.md
@@ -529,6 +529,9 @@ With `--verbose` or `-v`, many commands print extra debugging information. Note
Display where Homebrew's `.git` directory is located. For standard installs,
the `prefix` and `repository` are the same directory.
+ * `--repository` <user>`/`<repo>:
+ Display where tap <user>`/`<repo>'s directory is located.
+
* `--version`:
Print the version number of brew to standard error and exit.
diff --git a/Library/Homebrew/test/test_integration_cmds.rb b/Library/Homebrew/test/test_integration_cmds.rb
index 52606da08..8a7c85551 100644
--- a/Library/Homebrew/test/test_integration_cmds.rb
+++ b/Library/Homebrew/test/test_integration_cmds.rb
@@ -124,6 +124,11 @@ class IntegrationCommandTests < Homebrew::TestCase
cmd("--repository")
end
+ def test_repository
+ assert_match "#{HOMEBREW_LIBRARY}/Taps/foo/homebrew-bar",
+ cmd("--repository", "foo/bar")
+ end
+
def test_help
assert_match "Example usage:",
cmd("help")