Changeset View
Changeset View
Standalone View
Standalone View
support/shell/templates/bash-template.sh
- This file was moved from resources/shell/bash-completion.
| if [[ -n ${ZSH_VERSION-} ]]; then | _arcanist_complete_{{{BIN}}} () | ||||
| autoload -U +X bashcompinit && bashcompinit | |||||
| fi | |||||
| _arc () | |||||
| { | { | ||||
| CUR="${COMP_WORDS[COMP_CWORD]}" | |||||
| COMPREPLY=() | COMPREPLY=() | ||||
| OPTS=$(echo | arc shell-complete --current ${COMP_CWORD} -- ${COMP_WORDS[@]}) | |||||
| CUR="${COMP_WORDS[COMP_CWORD]}" | |||||
| OPTS=$(echo | {{{BIN}}} shell-complete --current ${COMP_CWORD} -- ${COMP_WORDS[@]} 2>/dev/null) | |||||
| if [ $? -ne 0 ]; then | if [ $? -ne 0 ]; then | ||||
| return $? | return $? | ||||
| fi | fi | ||||
| if [ "$OPTS" = "FILE" ]; then | if [ "$OPTS" = "FILE" ]; then | ||||
| COMPREPLY=( $(compgen -f -- ${CUR}) ) | COMPREPLY=( $(compgen -f -- ${CUR}) ) | ||||
| return 0 | return 0 | ||||
| fi | fi | ||||
| if [ "$OPTS" = "ARGUMENT" ]; then | if [ "$OPTS" = "ARGUMENT" ]; then | ||||
| return 0 | return 0 | ||||
| fi | fi | ||||
| COMPREPLY=( $(compgen -W "${OPTS}" -- ${CUR}) ) | COMPREPLY=( $(compgen -W "${OPTS}" -- ${CUR}) ) | ||||
| } | } | ||||
| complete -F _arc -o filenames arc | complete -F _arcanist_complete_{{{BIN}}} -o filenames {{{BIN}}} | ||||