From 66cbb352ebc7717f9bbd816b6e76bdcc347fdcb7 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 21 Aug 2012 17:26:21 +0200 Subject: balloon styles: -b and -B options are implemented --- completion/bash-completion.sh | 6 +++++- completion/fish-completion.fish | 9 ++++++--- completion/zsh-completion.zsh | 8 +++++--- 3 files changed, 16 insertions(+), 7 deletions(-) (limited to 'completion') diff --git a/completion/bash-completion.sh b/completion/bash-completion.sh index d790786..72cafcb 100644 --- a/completion/bash-completion.sh +++ b/completion/bash-completion.sh @@ -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 ) diff --git a/completion/fish-completion.fish b/completion/fish-completion.fish index 9233c67..ead664b 100644 --- a/completion/fish-completion.fish +++ b/completion/fish-completion.fish @@ -5,17 +5,20 @@ set -g ponies ('/usr/bin/ponysay' --onelist) set -g quoters ('/usr/bin/ponysay' --quoters) +set -g balloons ('/usr/bin/ponysay' --balloonlist) complete --command ponysay --short-option h --long-option help --description 'help of ponysay' complete --command ponysay --short-option v --long-option version --description 'version of ponysay' -complete --command ponysay --short-option l --long-option list --description 'list pony files' -complete --command ponysay --short-option L --long-option altlist --description 'list pony files with alternatives' +complete --command ponysay --short-option l --long-option list --description 'list pony names' +complete --command ponysay --short-option L --long-option altlist --description 'list pony names with alternatives' +complete --command ponysay --short-option B --long-option balloonlist --description 'list balloon style names' complete --command ponysay --short-option f --long-option pony --arguments "$ponies" --description 'pony' complete --command ponysay --short-option q --long-option quote --arguments "$quoters" --no-files --description 'pony' +complete --command ponysay --short-option b --long-option balloon --arguments "$balloons" --description 'balloon style' complete --command ponysay --short-option W --long-option wrap --arguments 'Integer' --description 'specify the column when the message should be wrapped' complete --command ponysay --arguments 'MESSAGE' set -e ponies set -e quoters - +set -e balloons diff --git a/completion/zsh-completion.zsh b/completion/zsh-completion.zsh index 2124380..c19604d 100644 --- a/completion/zsh-completion.zsh +++ b/completion/zsh-completion.zsh @@ -2,10 +2,12 @@ _shortopts=( '-v[Show version and exit]' '-h[Show this help and exit]' - '-l[list ponyfiles]' - '-L[list ponyfiles with alternatives]' - '-f[Select a pony (either a filename or a ponyname]: :_path_files -W '/usr/share/ponysay/ponies' -g "*(\:r)"' + '-l[list pony names]' + '-L[list pony names with alternatives]' + '-B[list balloon style names]' + '-f[Select a pony (either a file name or a pony name]: :_path_files -W '/usr/share/ponysay/ponies' -g "*(\:r)"' '-q[Select ponies for MLP:FiM quotes]' + '-b[Selecy a balloon style]' '-W[The screen column where the message should be wrapped]' ) _arguments -s : \ -- cgit From 8cc7a919b4cdd8b4a9c0873dfb0cb8f6ff3dac59 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 21 Aug 2012 21:41:08 +0200 Subject: misc --- completion/fish-completion.fish | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'completion') diff --git a/completion/fish-completion.fish b/completion/fish-completion.fish index ead664b..c211982 100644 --- a/completion/fish-completion.fish +++ b/completion/fish-completion.fish @@ -8,15 +8,15 @@ set -g quoters ('/usr/bin/ponysay' --quoters) set -g balloons ('/usr/bin/ponysay' --balloonlist) -complete --command ponysay --short-option h --long-option help --description 'help of ponysay' -complete --command ponysay --short-option v --long-option version --description 'version of ponysay' -complete --command ponysay --short-option l --long-option list --description 'list pony names' -complete --command ponysay --short-option L --long-option altlist --description 'list pony names with alternatives' -complete --command ponysay --short-option B --long-option balloonlist --description 'list balloon style names' -complete --command ponysay --short-option f --long-option pony --arguments "$ponies" --description 'pony' -complete --command ponysay --short-option q --long-option quote --arguments "$quoters" --no-files --description 'pony' -complete --command ponysay --short-option b --long-option balloon --arguments "$balloons" --description 'balloon style' -complete --command ponysay --short-option W --long-option wrap --arguments 'Integer' --description 'specify the column when the message should be wrapped' +complete --command ponysay --short-option h --long-option help --description 'help of ponysay' +complete --command ponysay --short-option v --long-option version --description 'version of ponysay' +complete --command ponysay --short-option l --long-option list --description 'list pony names' +complete --command ponysay --short-option L --long-option altlist --description 'list pony names with alternatives' +complete --command ponysay --short-option B --long-option balloonlist --description 'list balloon style names' +complete --command ponysay --short-option f --long-option pony --arguments "$ponies" --description 'pony' +complete --command ponysay --short-option q --long-option quote --arguments "$quoters" --description 'pony' +complete --command ponysay --short-option b --long-option balloon --arguments "$balloons" --description 'balloon style' +complete --command ponysay --short-option W --long-option wrap --arguments 'Integer' --description 'specify the column when the message should be wrapped' complete --command ponysay --arguments 'MESSAGE' set -e ponies -- cgit From f830ba4cf7b21b50406fbccf32535ebda11c2ed9 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 22 Aug 2012 16:25:35 +0200 Subject: misc --- completion/bash-completion.sh | 8 ++++++-- completion/fish-completion.fish | 5 +++++ completion/zsh-completion.zsh | 5 ++++- 3 files changed, 15 insertions(+), 3 deletions(-) (limited to 'completion') diff --git a/completion/bash-completion.sh b/completion/bash-completion.sh index 72cafcb..62e1d40 100644 --- a/completion/bash-completion.sh +++ b/completion/bash-completion.sh @@ -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" ) ) diff --git a/completion/fish-completion.fish b/completion/fish-completion.fish index c211982..c29fff2 100644 --- a/completion/fish-completion.fish +++ b/completion/fish-completion.fish @@ -4,21 +4,26 @@ # Author: Elis Axelsson set -g ponies ('/usr/bin/ponysay' --onelist) +set -g xponies ('/usr/bin/ponysay' ++onelist) set -g quoters ('/usr/bin/ponysay' --quoters) set -g balloons ('/usr/bin/ponysay' --balloonlist) +## TODO: update with options [see info manual]: +l +L ++list ++altlist ++file --file ++pony complete --command ponysay --short-option h --long-option help --description 'help of ponysay' complete --command ponysay --short-option v --long-option version --description 'version of ponysay' complete --command ponysay --short-option l --long-option list --description 'list pony names' complete --command ponysay --short-option L --long-option altlist --description 'list pony names with alternatives' complete --command ponysay --short-option B --long-option balloonlist --description 'list balloon style names' complete --command ponysay --short-option f --long-option pony --arguments "$ponies" --description 'pony' +complete --command ponysay --short-option F --arguments "$xponies" --description 'extra pony' complete --command ponysay --short-option q --long-option quote --arguments "$quoters" --description 'pony' complete --command ponysay --short-option b --long-option balloon --arguments "$balloons" --description 'balloon style' complete --command ponysay --short-option W --long-option wrap --arguments 'Integer' --description 'specify the column when the message should be wrapped' complete --command ponysay --arguments 'MESSAGE' + set -e ponies +set -e xponies set -e quoters set -e balloons diff --git a/completion/zsh-completion.zsh b/completion/zsh-completion.zsh index c19604d..9d417ec 100644 --- a/completion/zsh-completion.zsh +++ b/completion/zsh-completion.zsh @@ -4,8 +4,11 @@ _shortopts=( '-h[Show this help and exit]' '-l[list pony names]' '-L[list pony names with alternatives]' + '+l[list extra pony names]' + '+L[list extra pony names with alternatives]' '-B[list balloon style names]' - '-f[Select a pony (either a file name or a pony name]: :_path_files -W '/usr/share/ponysay/ponies' -g "*(\:r)"' + '-f[Select a pony (either a file name or a pony name)]: :_path_files -W '/usr/share/ponysay/ponies' -g "*(\:r)"' + '-F[Select a extra pony]: :_path_files -W '/usr/share/ponysay/extraponies' -g "*(\:r)"' '-q[Select ponies for MLP:FiM quotes]' '-b[Selecy a balloon style]' '-W[The screen column where the message should be wrapped]' -- cgit