aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorAdam Vandenberg2011-02-04 16:52:46 -0800
committerAdam Vandenberg2011-02-04 16:52:46 -0800
commit6864140237512451293d9a3b9d4c082fdeaaf11d (patch)
tree791a4d81ec4510e063689efffd645756b2e93773 /Library
parent97b8f9a31fa9dd67bc3760a3ab7974f6a80d4450 (diff)
downloadbrew-6864140237512451293d9a3b9d4c082fdeaaf11d.tar.bz2
brew --compact
Diffstat (limited to 'Library')
-rw-r--r--Library/Contributions/brew_bash_completion.sh2
-rwxr-xr-xLibrary/Contributions/examples/brew-options.rb16
2 files changed, 12 insertions, 6 deletions
diff --git a/Library/Contributions/brew_bash_completion.sh b/Library/Contributions/brew_bash_completion.sh
index 1d54ce5da..6fc3465f2 100644
--- a/Library/Contributions/brew_bash_completion.sh
+++ b/Library/Contributions/brew_bash_completion.sh
@@ -42,7 +42,7 @@ _brew_to_completion()
# Complete --options for selected brew
*)
[[ ${COMP_WORDS[1]} == "install" ]] && [[ "$cur" == --* ]] && {
- COMPREPLY=( $(compgen -W "$(brew options "$prev" | grep -P "^--")" -- ${cur}) )
+ COMPREPLY=( $(compgen -W "$(brew options --compact "$prev")" -- ${cur}) )
return
}
;;
diff --git a/Library/Contributions/examples/brew-options.rb b/Library/Contributions/examples/brew-options.rb
index bf7a0180a..4b110232d 100755
--- a/Library/Contributions/examples/brew-options.rb
+++ b/Library/Contributions/examples/brew-options.rb
@@ -1,9 +1,15 @@
+compact = ARGV.include? '--compact'
+
ARGV.formulae.each do |f|
f.options rescue next
- puts f.name
- f.options.each do |o|
- puts o[0]
- puts "\t"+o[1]
+ if compact
+ puts f.options.collect {|o| o[0]} * " "
+ else
+ puts f.name
+ f.options.each do |o|
+ puts o[0]
+ puts "\t"+o[1]
+ end
+ puts
end
- puts
end