2012-05-12 02:57:40 +02:00
|
|
|
# bash completion for ponysay -*- shell-script -*-
|
|
|
|
|
|
|
|
_ponysay()
|
|
|
|
{
|
|
|
|
local cur prev words cword
|
|
|
|
_init_completion -n = || return
|
|
|
|
|
2012-08-16 18:36:52 +02:00
|
|
|
options='-v -h -l -f -W -q'
|
2012-07-19 04:32:35 +02:00
|
|
|
COMPREPLY=( $( compgen -W "$options" -- "$cur" ) )
|
2012-05-12 02:57:40 +02:00
|
|
|
|
2012-08-18 16:37:55 +02:00
|
|
|
if [ $prev = "-f" ]; then
|
|
|
|
ponies=$('/usr/bin/ponysay.py' --onelist)
|
|
|
|
COMPREPLY=( $( compgen -W "$ponies" -- "$cur" ) )
|
|
|
|
|
|
|
|
elif [ $prev = "-q" ]; then
|
|
|
|
quoters=$('/usr/bin/ponysay.py' --quoters)
|
|
|
|
COMPREPLY=( $( compgen -W "$quoters" -- "$cur" ) )
|
2012-08-18 02:34:54 +02:00
|
|
|
|
|
|
|
elif [ $prev = "-W" ]; then
|
2012-07-19 04:32:35 +02:00
|
|
|
cols=$(( `stty size | cut -d ' ' -f 2` - 10 ))
|
|
|
|
COMPREPLY=( $cols $(( $cols / 2 )) 100 60 )
|
2012-08-18 02:34:54 +02:00
|
|
|
|
2012-05-12 02:57:40 +02:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
complete -o default -F _ponysay ponysay
|
|
|
|
|