balloon styles: -b and -B options are implemented
This commit is contained in:
parent
b66b3b5bfc
commit
66cbb352eb
6 changed files with 116 additions and 41 deletions
|
|
@ -5,7 +5,7 @@ _ponysay()
|
|||
local cur prev words cword
|
||||
_init_completion -n = || return
|
||||
|
||||
options='--version --help --list --altlist --pony --wrap --quote'
|
||||
options='--version --help --list --altlist --pony --wrap --quote --balloonlist --balloon'
|
||||
COMPREPLY=( $( compgen -W "$options" -- "$cur" ) )
|
||||
|
||||
if [ $prev = "-f" ] || [ $prev = "--pony" ]; then
|
||||
|
|
@ -16,6 +16,10 @@ _ponysay()
|
|||
quoters=$('/usr/bin/ponysay' --quoters)
|
||||
COMPREPLY=( $( compgen -W "$quoters" -- "$cur" ) )
|
||||
|
||||
elif [ $prev = "-b" ] || [ $prev = "--balloon" ]; 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 )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue