ocarina: Add in bash command completion

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
This commit is contained in:
Bryan Schumaker 2012-09-13 21:54:47 -04:00
parent 8a08967a48
commit 31339bed2f
1 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,18 @@
_ocarina()
{
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
cmd="${COMP_WORDS[1]}"
if [ $COMP_CWORD -eq 1 ]; then
opts=`compgen -c "ocarina-" | awk -F "-" '{print $2}'`
opts="$opts next pause play prev stop toggle"
fi
COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
return 0
}
complete -F _ocarina ocarina