]> arthur.barton.de Git - brew-completion.git/blobdiff - brew-completion.sh
Updated ChangeLog for release 7
[brew-completion.git] / brew-completion.sh
index c14827b09bc6121bcc34d6c68eb85aa743f06a67..54fd003285209cfe3b7dac770aeab8a8e4676655 100644 (file)
@@ -31,8 +31,16 @@ _brew()
        cmd=""
 
        # Get list of all available external commands
-       EXTCMD=`cd /usr/local/bin; ls -1 brew-* | cut -d'.' -f1 \
-               | cut -d'-' -f2- | sed -e 's/\*//g'`
+       extcmdpath="`brew --prefix`/Library/Homebrew/cmd";
+       if [ -d "$extcmdpath" ]; then
+               EXTCMD="$EXTCMD `cd "$extcmdpath"; ls -1 -- *.rb 2>/dev/null \
+                       | cut -d'.' -f1`"
+       fi
+       examplespath="`brew --prefix`/Library/Contributions/examples"
+       if [ -d "$examplespath" ]; then
+               EXTCMD="$EXTCMD `cd "$examplespath"; ls -1 -- brew-* 2>/dev/null \
+                       | cut -d'.' -f1 | cut -d'-' -f2- | sed -e 's/\*//g'`"
+       fi
 
        declare -i i=$COMP_CWORD-1
        while [ $i -gt 0 ]; do
@@ -105,7 +113,7 @@ _brew()
 
        if [[ "$cur" == -* ]]; then
                COMPREPLY=( $(compgen -W '--cache --cellar --config \
-                       --help --prefix --version -v -H' \
+                       --env --help --prefix --version -v -H' \
                        -- "$cur") )
        elif [ "$cmd" = "" ]; then
                COMPREPLY=( $(compgen -W 'cat cleanup create deps doctor \