X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=brew-completion.sh;h=54fd003285209cfe3b7dac770aeab8a8e4676655;hb=720444bb47f05d6c6a0d232b7f3564c4b03241d4;hp=20691214fbf807c52399ea1e952f2fc982c9fb5c;hpb=091afd085201a98d3d9f8c01e0bb7d9d3a062b49;p=brew-completion.git diff --git a/brew-completion.sh b/brew-completion.sh index 2069121..54fd003 100644 --- a/brew-completion.sh +++ b/brew-completion.sh @@ -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