From cf3886c22ab82a7fdc0132ddfadbbc0c4745bda9 Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Wed, 16 Mar 2011 18:14:18 +0100 Subject: [PATCH] Update generation of external commands list for brew 0.8 --- brew-completion.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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 -- 2.39.2