add brew where command
This commit is contained in:
parent
cf18a999f1
commit
ae829ed229
@ -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:
|
||||
|
15
Library/Homebrew/dev-cmd/where.rb
Normal file
15
Library/Homebrew/dev-cmd/where.rb
Normal file
@ -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
|
@ -120,6 +120,7 @@ __brew_common_commands() {
|
||||
'update:fetch latest version of Homebrew and all formulae'
|
||||
'upgrade:upgrade outdated formulae'
|
||||
'uses:show formulae which depend on a formula'
|
||||
'where:location of formulae'
|
||||
'--cellar:brew cellar'
|
||||
'--env:brew environment'
|
||||
'--repository:brew repository'
|
||||
@ -793,6 +794,12 @@ _brew_vendor_install() {
|
||||
'--target'
|
||||
}
|
||||
|
||||
|
||||
# brew where formulae:
|
||||
_brew_where() {
|
||||
__brew_formulae
|
||||
}
|
||||
|
||||
# the main completion function
|
||||
_brew() {
|
||||
local curcontext="$curcontext" state state_descr line expl
|
||||
|
@ -625,6 +625,7 @@ between tags.</p>
|
||||
|
||||
<p>If <code>--keep-tmp</code> is passed, retain the temporary directory containing
|
||||
the new repository clone.</p></dd>
|
||||
<dt><code>where</code> <var>formulae</var></dt><dd><p>echo location of the specified <var>formulae</var> to stdout</p></dd>
|
||||
</dl>
|
||||
|
||||
|
||||
|
@ -823,6 +823,10 @@ If \fB\-\-to\-tag\fR is passed, set HOMEBREW_UPDATE_TO_TAG to test updating betw
|
||||
.IP
|
||||
If \fB\-\-keep\-tmp\fR is passed, retain the temporary directory containing the new repository clone\.
|
||||
.
|
||||
.TP
|
||||
\fBwhere\fR \fIformulae\fR
|
||||
echo location of the specified \fIformulae\fR to stdout
|
||||
.
|
||||
.SH "OFFICIAL EXTERNAL COMMANDS"
|
||||
.
|
||||
.TP
|
||||
|
Loading…
x
Reference in New Issue
Block a user