]> arthur.barton.de Git - brew-completion.git/commitdiff
Enable "brew {--cache|--cellar|--prefix}" to complete formula name
authorAlexander Barton <alex@barton.de>
Mon, 7 Jun 2010 11:37:43 +0000 (13:37 +0200)
committerAlexander Barton <alex@barton.de>
Mon, 7 Jun 2010 11:37:43 +0000 (13:37 +0200)
brew-completion.sh

index f05a585809bc70c5775f4c2f87a17d80f5838641..0934cff9aea01cb43b15c7b132de9eb10fb66b13 100644 (file)
@@ -32,7 +32,10 @@ _brew()
 
        declare -i i=$COMP_CWORD-1
        while [ $i -gt 0 ]; do
-               if [[ ${COMP_WORDS[i]} != -* ]]; then
+               if [[ ${COMP_WORDS[i]} != -* \
+                  || ${COMP_WORDS[i]} == "--cache" \
+                  || ${COMP_WORDS[i]} == "--cellar" \
+                  || ${COMP_WORDS[i]} == "--prefix" ]]; then
                        cmd=${COMP_WORDS[i]}
                        break
                fi
@@ -40,7 +43,8 @@ _brew()
        done
 
        case "$cmd" in
-               "cleanup"|"edit"|"home"|"log"|"prune")
+               "cleanup"|"edit"|"home"|"log"|"prune" \
+               |"--cache"|"--cellar"|"--prefix")
                        _brew_formula "$cur"
                        return 0
                        ;;