aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Contributions/brew_bash_completion.sh16
1 files changed, 10 insertions, 6 deletions
diff --git a/Library/Contributions/brew_bash_completion.sh b/Library/Contributions/brew_bash_completion.sh
index e0cda943a..5f7a45db5 100644
--- a/Library/Contributions/brew_bash_completion.sh
+++ b/Library/Contributions/brew_bash_completion.sh
@@ -61,14 +61,18 @@ __brew_complete_formulae ()
{
local cur="${COMP_WORDS[COMP_CWORD]}"
local lib=$(brew --repository)/Library
+ local taps=${lib}/Taps
local ff=$(\ls ${lib}/Formula 2>/dev/null | sed 's/\.rb//g')
local af=$(\ls ${lib}/Aliases 2>/dev/null)
- local tf tap
-
- for dir in $(\ls ${lib}/Taps 2>/dev/null); do
- tap="$(echo "$dir" | sed 's|-|/|g')"
- tf="$tf $(\ls -1R "${lib}/Taps/${dir}" 2>/dev/null |
- grep '.\+.rb' | sed -E 's|(.+)\.rb|'"${tap}"'/\1|g')"
+ local tf file
+
+ for file in ${taps}/*/*.rb ${taps}/*/Formula/*.rb ${taps}/*/HomebrewFormula/*.rb; do
+ file=${file/"Formula/"/}
+ file=${file/"HomebrewFormula/"/}
+ file=${file#${lib}/Taps/}
+ file=${file%.rb}
+ file=${file/-//}
+ tf="${tf} ${file}"
done
COMPREPLY=($(compgen -W "$ff $af $tf" -- "$cur"))