_grit() { local cur prev opts COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" opts="pull push force update refresh bronch dif diff init commit cad cal uncommit amend sad sup" if [ $COMP_CWORD == 1 ]; then COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) else COMPREPLY=() fi return 0 } complete -o default -F _grit grit