diff options
| author | Jack Nagel | 2012-03-16 19:11:30 -0500 |
|---|---|---|
| committer | Jack Nagel | 2012-03-16 19:18:58 -0500 |
| commit | 406582dcad68d198ffb712ba21d12b485336c55d (patch) | |
| tree | 7f4a59a1685978f23246377b9bfc89ebf140c0c7 /Library | |
| parent | 19f1a328e3f8079e79fe81cf6b45be330022b3b6 (diff) | |
| download | homebrew-406582dcad68d198ffb712ba21d12b485336c55d.tar.bz2 | |
Tab completion for tapped formulae
So you can do e.g.
$ brew install adamv<TAB>
Display all 106 possibilities? (y or n)
$ brew install adamv/alt/openss<TAB>
adamv/alt/openssh adamv/alt/openssl098 adamv/alt/openssl100
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Contributions/brew_bash_completion.sh | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Library/Contributions/brew_bash_completion.sh b/Library/Contributions/brew_bash_completion.sh index 313517e4a..d11379064 100644 --- a/Library/Contributions/brew_bash_completion.sh +++ b/Library/Contributions/brew_bash_completion.sh @@ -82,7 +82,15 @@ __brew_complete_formulae () local cur="${COMP_WORDS[COMP_CWORD]}" local ff=$(\ls $(brew --repository)/Library/Formula 2>/dev/null | sed 's/\.rb//g') local af=$(\ls $(brew --repository)/Library/Aliases 2>/dev/null | sed 's/\.rb//g') - COMPREPLY=($(compgen -W "$ff $af" -- "$cur")) + local tf tap + + for dir in $(\ls $(brew --repository)/Library/Taps 2>/dev/null); do + tap="$(echo "$dir" | sed 's|-|/|g')" + tf="$tf $(\ls -1R "$(brew --repository)/Library/Taps/$dir" 2>/dev/null | + grep '.\+.rb' | sed -E 's|(.+)\.rb|'"${tap}"'/\1|g')" + done + + COMPREPLY=($(compgen -W "$ff $af $tf" -- "$cur")) } __brew_complete_installed () |
