From: Alexander Barton Date: Sun, 10 Jan 2010 17:23:51 +0000 (+0100) Subject: Don't scan directories, use "brew search" and "brew list" X-Git-Tag: rel-1~5 X-Git-Url: https://arthur.barton.de/gitweb/?a=commitdiff_plain;h=0539ba65a9f46f6b8ce6763101168775a69886f4;hp=bdd69d18e9512162180fcdd3235d76060e86c718;p=brew-completion.git Don't scan directories, use "brew search" and "brew list" --- diff --git a/brew-completion.sh b/brew-completion.sh index c0c0e4e..1bb21d2 100644 --- a/brew-completion.sh +++ b/brew-completion.sh @@ -8,9 +8,7 @@ _brew_formula() local formulae prefix prefix=`brew --prefix` - pushd "$prefix"/Library/Formula >/dev/null - formulae=`echo * | sed 's/\.rb//g'` - popd >/dev/null + formulae=`brew search` COMPREPLY=( $(compgen -W '$formulae' -- "$1") ) } @@ -19,9 +17,7 @@ _brew_formula_installed() local formulae prefix prefix=`brew --prefix` - pushd "$prefix"/Cellar >/dev/null - formulae=`echo *` - popd >/dev/null + formulae=`brew list` COMPREPLY=( $(compgen -W '$formulae' -- "$1") ) }