This commit is contained in:
Mattias Andrée 2012-08-22 16:25:35 +02:00
parent a84f1d6534
commit f830ba4cf7
6 changed files with 79 additions and 10 deletions

View file

@ -5,13 +5,17 @@ _ponysay()
local cur prev words cword
_init_completion -n = || return
options='--version --help --list --altlist --pony --wrap --quote --balloonlist --balloon'
options='--version --help --list --altlist --pony --wrap --quote --balloonlist --balloon --file ++file ++pony ++list ++altlist'
COMPREPLY=( $( compgen -W "$options" -- "$cur" ) )
if [ $prev = "-f" ] || [ $prev = "--pony" ]; then
if [ $prev = "-f" ] || [ $prev = "--pony" ] || [ $prev = "--file" ]; then
ponies=$('/usr/bin/ponysay' --onelist)
COMPREPLY=( $( compgen -W "$ponies" -- "$cur" ) )
elif [ $prev = "-F" ] || [ $prev = "++pony" ] || [ $prev = "++file" ]; then
extraponies=$('/usr/bin/ponysay' ++onelist)
COMPREPLY=( $( compgen -W "$extraponies" -- "$cur" ) )
elif [ $prev = "-q" ] || [ $prev = "--quote" ]; then
quoters=$('/usr/bin/ponysay' --quoters)
COMPREPLY=( $( compgen -W "$quoters" -- "$cur" ) )