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
commitb0ae301c5a1d3c0c2efc7295d7cd20a6ab5b505c (patch)
tree484ad24e6eb6c03f6b4de3c104391727e6f41474 /Library
parent73e955fcc5461eb33016ce583d9a9cc6f01654a8 (diff)
downloadhomebrew-b0ae301c5a1d3c0c2efc7295d7cd20a6ab5b505c.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