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'`
+ 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'`
+ fi
declare -i i=$COMP_CWORD-1
while [ $i -gt 0 ]; do