if [[ ${COMP_WORDS[i]} != -* \
|| ${COMP_WORDS[i]} == "--cache" \
|| ${COMP_WORDS[i]} == "--cellar" \
+ || ${COMP_WORDS[i]} == "--config" \
|| ${COMP_WORDS[i]} == "--prefix" ]]; then
cmd=${COMP_WORDS[i]}
break
done
case "$cmd" in
- "cleanup"|"edit"|"home"|"log"|"prune" \
+ "cat"|"cleanup"|"deps"|"edit"|"home"|"log"|"prune"|"uses" \
|"--cache"|"--cellar"|"--prefix")
_brew_formula "$cur"
return 0
;;
- "link"|"remove"|"uninstall"|"unlink")
+ "link"|"remove"|"rm"|"uninstall"|"unlink")
_brew_formula_installed "$cur"
return 0
;;
"create")
if [[ "$cur" == -* ]]; then
- COMPREPLY=( $(compgen -W '--macports' \
- -- "$cur") )
+ COMPREPLY=( $(compgen -W '--macports --fink \
+ --cache' -- "$cur") )
fi
return 0
;;
"info")
if [[ "$cur" == -* ]]; then
- COMPREPLY=( $(compgen -W '--github' \
+ COMPREPLY=( $(compgen -W '--all --github' \
-- "$cur") )
else
_brew_formula "$cur"
;;
"install")
if [[ "$cur" == -* ]]; then
- COMPREPLY=( $(compgen -W '--HEAD -H \
+ COMPREPLY=( $(compgen -W '--git --HEAD -H \
--debug -d --interactive -i
--verbose -v --ignore-dependencies' \
-- "$cur") )
fi
return 0
;;
- "search"|"update")
- return 0
- ;;
*)
for c in $EXTCMD; do
if [ "$cmd" = "$c" ]; then
esac
if [[ "$cur" == -* ]]; then
- COMPREPLY=( $(compgen -W '--cache --cellar --help --prefix \
- --version -v -H' -- "$cur") )
+ COMPREPLY=( $(compgen -W '--cache --cellar --config \
+ --help --prefix --version -v -H' \
+ -- "$cur") )
elif [ "$cmd" = "" ]; then
- COMPREPLY=( $(compgen -W 'cleanup create edit home info \
- install link list log outdated prune remove search \
- uninstall unlink update $EXTCMD' -- "$cur") )
+ COMPREPLY=( $(compgen -W 'cat cleanup create deps edit home \
+ info install link list log outdated prune remove rm \
+ search uninstall unlink update uses $EXTCMD' \
+ -- "$cur") )
fi
}
complete -F _brew brew