]> arthur.barton.de Git - brew-completion.git/commitdiff
Update generation of external commands list for brew 0.8
authorAlexander Barton <alex@barton.de>
Wed, 16 Mar 2011 17:14:18 +0000 (18:14 +0100)
committerAlexander Barton <alex@barton.de>
Wed, 16 Mar 2011 17:14:18 +0000 (18:14 +0100)
brew-completion.sh

index 20691214fbf807c52399ea1e952f2fc982c9fb5c..54fd003285209cfe3b7dac770aeab8a8e4676655 100644 (file)
@@ -31,10 +31,15 @@ _brew()
        cmd=""
 
        # Get list of all available external commands
-       extpath="`brew --prefix`/Library/Contributions/examples"
-       if [ -d "$extpath" ]; then
-               EXTCMD=`cd "$extpath"; ls -1 brew-* 2>/dev/null \
-                       | 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