]> arthur.barton.de Git - brew-completion.git/commitdiff
Don't scan directories, use "brew search" and "brew list"
authorAlexander Barton <alex@barton.de>
Sun, 10 Jan 2010 17:23:51 +0000 (18:23 +0100)
committerAlexander Barton <alex@barton.de>
Sun, 10 Jan 2010 17:23:51 +0000 (18:23 +0100)
brew-completion.sh

index c0c0e4e8d20917b2fa43bf212c4d2e6f60694db6..1bb21d286ffcb5096079b4ece2ee4dbab200e75f 100644 (file)
@@ -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") )
 }