diff options
| author | Justin Hileman | 2011-02-04 18:21:23 -0500 |
|---|---|---|
| committer | Adam Vandenberg | 2011-02-04 16:46:04 -0800 |
| commit | 73e955fcc5461eb33016ce583d9a9cc6f01654a8 (patch) | |
| tree | 7327227b1ff4d630f1e3d1a3460bd752622bb21d /Library | |
| parent | 3b9f1d1c7d7b9eb80092a12a6bf689810cc4005b (diff) | |
| download | homebrew-73e955fcc5461eb33016ce583d9a9cc6f01654a8.tar.bz2 | |
bash completion: --options for `brew install foo`
To trigger the option autocompletion, type:
brew install foo --[tab][tab]
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Contributions/brew_bash_completion.sh | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Library/Contributions/brew_bash_completion.sh b/Library/Contributions/brew_bash_completion.sh index e12d375d2..1d54ce5da 100644 --- a/Library/Contributions/brew_bash_completion.sh +++ b/Library/Contributions/brew_bash_completion.sh @@ -39,6 +39,13 @@ _brew_to_completion() COMPREPLY=( $(compgen -W "$(\ls $(brew --cellar))" -- ${cur}) ) return ;; + # Complete --options for selected brew + *) + [[ ${COMP_WORDS[1]} == "install" ]] && [[ "$cur" == --* ]] && { + COMPREPLY=( $(compgen -W "$(brew options "$prev" | grep -P "^--")" -- ${cur}) ) + return + } + ;; esac } |
