aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorTimothee Cour2017-02-07 23:25:02 -0800
committerTimothee Cour2017-02-11 16:38:06 -0800
commitae829ed229395159adf6f1f17fb26518ec27fca6 (patch)
treef8be41af53a8d4e1f5a6e01834eba111d967f2e5 /Library
parentcf18a999f1b6b0d8932260ed1ff9ede30c338515 (diff)
downloadbrew-ae829ed229395159adf6f1f17fb26518ec27fca6.tar.bz2
add brew where command
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/help.rb2
-rw-r--r--Library/Homebrew/dev-cmd/where.rb15
2 files changed, 16 insertions, 1 deletions
diff --git a/Library/Homebrew/cmd/help.rb b/Library/Homebrew/cmd/help.rb
index 1378e7b1f..70379314e 100644
--- a/Library/Homebrew/cmd/help.rb
+++ b/Library/Homebrew/cmd/help.rb
@@ -15,7 +15,7 @@ Troubleshooting:
Developers:
brew create [URL [--no-fetch]]
- brew edit [FORMULA...]
+ brew (where|edit) [FORMULA...]
http://docs.brew.sh/Formula-Cookbook.html
Further help:
diff --git a/Library/Homebrew/dev-cmd/where.rb b/Library/Homebrew/dev-cmd/where.rb
new file mode 100644
index 000000000..63237301b
--- /dev/null
+++ b/Library/Homebrew/dev-cmd/where.rb
@@ -0,0 +1,15 @@
+#: * `where` <formulae>:
+#: echo location of the specified <formulae> to stdout
+
+require "formula"
+
+module Homebrew
+ module_function
+
+ def where
+ raise FormulaUnspecifiedError if ARGV.named.empty?
+ ARGV.resolved_formulae.each do |f|
+ puts "#{f.path}\n"
+ end
+ end
+end