]> arthur.barton.de Git - brew-completion.git/blobdiff - brew-completion.sh
Fix year in copyright notices: it's 2010!
[brew-completion.git] / brew-completion.sh
index c0c0e4e8d20917b2fa43bf212c4d2e6f60694db6..4a55b27b6fdeea566df3b9d391289952893e511d 100644 (file)
@@ -1,5 +1,5 @@
 # brew-completion: bash completion function for Homebrew (brew command)
-# Copyright (c)1020 Alexander Barton <alex@barton.de>
+# Copyright (c)2010 Alexander Barton <alex@barton.de>
 # This is free software and published under the terms of the GNU
 # General Public License, see the file COPYING for details.
 
@@ -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") )
 }
 
@@ -44,7 +40,7 @@ _brew()
        done
 
        case "$cmd" in
-               "edit"|"home"|"log"|"prune")
+               "cleanup"|"edit"|"home"|"log"|"prune")
                        _brew_formula "$cur"
                        return 0
                        ;;
@@ -97,9 +93,9 @@ _brew()
                COMPREPLY=( $(compgen -W '--cache --help --prefix --version \
                        -v -H' -- "$cur") )
        elif [ "$cmd" = "" ]; then
-               COMPREPLY=( $(compgen -W 'create edit home info install \
-                       link list log prune remove search uninstall unlink \
-                       update' -- "$cur") )
+               COMPREPLY=( $(compgen -W 'cleanup create edit home info \
+                       install link list log prune remove search uninstall \
+                       unlink update' -- "$cur") )
        fi
 }
 complete -F _brew brew