mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
brew home foo open's foo's homepage in default web-browser
This commit is contained in:
parent
db15b323bb
commit
14da66fb77
@ -1,6 +1,6 @@
|
||||
# This script contains bash completions for brew.
|
||||
# To use, edit your .bashrc and add the line:
|
||||
# source <path-to-homebrew>/Library/Contributions/brew_bash_completion.sh
|
||||
# source `brew --prefix`/Library/Contributions/brew_bash_completion.sh
|
||||
#
|
||||
# Assuming you have brew installed in /usr/local, then you'll want:
|
||||
# source /usr/local/Library/Contributions/brew_bash_completion.sh
|
||||
@ -28,7 +28,7 @@ _brew_to_completion()
|
||||
|
||||
case ${prev} in
|
||||
# Commands that take a formula...
|
||||
edit|install)
|
||||
edit|install|home)
|
||||
formulae=`ls ${brew_base}/Library/Formula/ | sed "s/\.rb//g"`
|
||||
COMPREPLY=( $(compgen -W "${formulae}" -- ${cur}) )
|
||||
return 0
|
||||
|
4
bin/brew
4
bin/brew
@ -199,6 +199,10 @@ begin
|
||||
when '-v', '--version' then puts HOMEBREW_VERSION
|
||||
when 'macports' then exec "open 'http://www.macports.org/ports.php?by=name&substr=#{ARGV.shift}'"
|
||||
|
||||
when 'home', 'homepage'
|
||||
homepages=extract_names.collect {|keg| Formula.create(name).homepage}
|
||||
exec "open #{homepages.join' '}"
|
||||
|
||||
when 'ls', 'list'
|
||||
dirs=extract_kegs.collect {|keg| keg.path}
|
||||
exec "find #{dirs.join' '} -not -type d -print"
|
||||
|
Loading…
x
Reference in New Issue
Block a user