diff options
| author | Adam Vandenberg | 2011-02-04 16:52:46 -0800 |
|---|---|---|
| committer | Adam Vandenberg | 2011-02-04 16:52:46 -0800 |
| commit | b0ae301c5a1d3c0c2efc7295d7cd20a6ab5b505c (patch) | |
| tree | 484ad24e6eb6c03f6b4de3c104391727e6f41474 /Library | |
| parent | 73e955fcc5461eb33016ce583d9a9cc6f01654a8 (diff) | |
| download | homebrew-b0ae301c5a1d3c0c2efc7295d7cd20a6ab5b505c.tar.bz2 | |
brew --compact
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Contributions/brew_bash_completion.sh | 2 | ||||
| -rwxr-xr-x | Library/Contributions/examples/brew-options.rb | 16 |
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 |
