2011-11-10 01:37:32 +01:00
|
|
|
_arc ()
|
2011-01-15 05:00:11 +01:00
|
|
|
{
|
|
|
|
CUR="${COMP_WORDS[COMP_CWORD]}"
|
|
|
|
COMPREPLY=()
|
2011-11-10 01:37:32 +01:00
|
|
|
OPTS=$(echo | arc shell-complete --current ${COMP_CWORD} -- ${COMP_WORDS[@]})
|
|
|
|
|
2011-01-15 05:00:11 +01:00
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
return $?
|
|
|
|
fi
|
2011-11-10 01:37:32 +01:00
|
|
|
|
2011-01-15 05:00:11 +01:00
|
|
|
if [ "$OPTS" = "FILE" ]; then
|
|
|
|
COMPREPLY=( $(compgen -f -- ${CUR}) )
|
|
|
|
return 0
|
|
|
|
fi
|
2011-11-10 01:37:32 +01:00
|
|
|
|
2011-01-15 05:00:11 +01:00
|
|
|
if [ "$OPTS" = "ARGUMENT" ]; then
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
|
2011-11-10 01:37:32 +01:00
|
|
|
COMPREPLY=( $(compgen -W "${OPTS}" -- ${CUR}) )
|
2011-01-15 05:00:11 +01:00
|
|
|
}
|
|
|
|
complete -F _arc -o filenames arc
|