diff --git a/Library/Contributions/brew_bash_completion.sh b/Library/Contributions/brew_bash_completion.sh index 313517e4aa..d11379064f 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 ()