1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-08 16:02:39 +01:00
phorge-arcanist/resources/shell/bash-completion
2012-01-09 11:52:51 -08:00

26 lines
502 B
Text

if [[ -n ${ZSH_VERSION-} ]]; then
autoload -U +X bashcompinit && bashcompinit
fi
_arc ()
{
CUR="${COMP_WORDS[COMP_CWORD]}"
COMPREPLY=()
OPTS=$(echo | arc shell-complete --current ${COMP_CWORD} -- ${COMP_WORDS[@]})
if [ $? -ne 0 ]; then
return $?
fi
if [ "$OPTS" = "FILE" ]; then
COMPREPLY=( $(compgen -f -- ${CUR}) )
return 0
fi
if [ "$OPTS" = "ARGUMENT" ]; then
return 0
fi
COMPREPLY=( $(compgen -W "${OPTS}" -- ${CUR}) )
}
complete -F _arc -o filenames arc