diff options
Diffstat (limited to 'completion/bash-completion.sh')
-rwxr-xr-x[-rw-r--r--] | completion/bash-completion.sh | 45 |
1 files changed, 15 insertions, 30 deletions
diff --git a/completion/bash-completion.sh b/completion/bash-completion.sh index ae6a744..6a346f5 100644..100755 --- a/completion/bash-completion.sh +++ b/completion/bash-completion.sh @@ -1,36 +1,21 @@ -# bash completion for ponysay -*- shell-script -*- +#!bash +# +# this is bash completion function file for ponysay.py. +# generated by genzshcomp(ver: 0.5.1) +# -_ponysay() +_ponysay.py() { - local cur prev words cword - _init_completion -n = || return - - options="--version --help --list --altlist --pony --wrap --quote --balloonlist --balloon --file ++file ++pony ++list ++altlist --all ++all" - options="$options --256-colours --tty-colours --kms-colours" - COMPREPLY=( $( compgen -W "$options" -- "$cur" ) ) - - if [ $prev = "-f" ] || [ $prev = "--pony" ] || [ $prev = "--file" ]; then - ponies=$('/usr/bin/ponysay' --onelist) - COMPREPLY=( $( compgen -W "$ponies" -- "$cur" ) ) + local cur + local cmd - elif [ $prev = "-F" ] || [ $prev = "++pony" ] || [ $prev = "++file" ]; then - extraponies=$('/usr/bin/ponysay' ++onelist) - COMPREPLY=( $( compgen -W "$extraponies" -- "$cur" ) ) + cur=${COMP_WORDS[$COMP_CWORD]} + cmd=( ${COMP_WORDS[@]} ) - elif [ $prev = "-q" ] || [ $prev = "--quote" ]; then - quoters=$('/usr/bin/ponysay' --quoters) - COMPREPLY=( $( compgen -W "$quoters" -- "$cur" ) ) - - elif [ $prev = "-b" ] || [ $prev = "--balloon" ] || [ $prev = "--bubble" ]; then - balloons=$('/usr/bin/ponysay' --balloonlist) - COMPREPLY=( $( compgen -W "$balloons" -- "$cur" ) ) - - elif [ $prev = "-W" ] || [ $prev = "--wrap" ]; then - cols=$(( `stty size | cut -d ' ' -f 2` - 10 )) - COMPREPLY=( $cols $(( $cols / 2 )) 100 60 none inherit ) - - fi + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W "-h --help --pony -p --quote -q --center -c --center-text -C --width -w --balloon -b" -- $cur ) ) + return 0 + fi } -complete -o default -F _ponysay ponysay - +complete -F _ponysay.py -o default ponysay.py |