mirror of
https://github.com/erkin/ponysay
synced 2024-11-16 00:17:59 +00:00
change shell completion accordingly
This commit is contained in:
parent
5fd404eef3
commit
8a7d9551ff
3 changed files with 5 additions and 5 deletions
|
@ -13,7 +13,7 @@ _ponysay()
|
|||
ponies=$('/usr/bin/ponysay' --onelist)
|
||||
COMPREPLY=( $( compgen -W "$ponies" -- "$cur" ) )
|
||||
|
||||
elif [ $prev = "-F" ] || [ $prev = "++pony" ] || [ $prev = "++file" ]; then
|
||||
elif [ $prev = "+f" ] || [ $prev = "++pony" ] || [ $prev = "++file" ]; then
|
||||
extraponies=$('/usr/bin/ponysay' ++onelist)
|
||||
COMPREPLY=( $( compgen -W "$extraponies" -- "$cur" ) )
|
||||
|
||||
|
|
|
@ -7,14 +7,14 @@ 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 {-A, +A, -V, -K, -X}(with alternative)
|
||||
## TODO: update with options [see info manual]: +f +l +L ++list ++altlist ++file --file ++pony {-A, +A, -V, -K, -X}(with alternative)
|
||||
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 F --arguments "$xponies" --desc#ription 'extra 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" --no-files --description 'balloon style'
|
||||
complete --command ponysay --short-option W --long-option wrap --arguments 'Integer' --description 'specify the column when the message should be wrapped' ## TODO arguments `none` and `inherit` should be suggested
|
||||
|
|
|
@ -15,12 +15,12 @@ _opts=(
|
|||
_tty_select=(
|
||||
'(-q --quite)'{-q,--quote}'[Select ponies for MLP:FiM quotes]: :_path_files -W '/usr/share/ponysay/ttyponies' -g "*(\:r)"'
|
||||
'(-f --pony)'{-f,--pony}'[select pony]: :_path_files -W '/usr/share/ponysay/ttyponies/' -g "*(\:r)"'
|
||||
'(-F ++pony)'{-F,++pony}'[Select a extra pony]: :_path_files -W '/usr/share/ponysay/extrattyponies' -g "*(\:r)"'
|
||||
'(+f ++pony)'{+f,++pony}'[Select a extra pony]: :_path_files -W '/usr/share/ponysay/extrattyponies' -g "*(\:r)"'
|
||||
)
|
||||
_select=(
|
||||
'(-q --quite)'{-q,--quote}'[Select ponies for MLP:FiM quotes]: :_path_files -W '/usr/share/ponysay/ponies' -g "*(\:r)"'
|
||||
'(-f --pony)'{-f,--pony}'[select pony]: :_path_files -W '/usr/share/ponysay/ponies/' -g "*(\:r)"'
|
||||
'(-F ++pony)'{-F,++pony}'[Select a extra pony]: :_path_files -W '/usr/share/ponysay/extraponies' -g "*(\:r)"'
|
||||
'(+f ++pony)'{+f,++pony}'[Select a extra pony]: :_path_files -W '/usr/share/ponysay/extraponies' -g "*(\:r)"'
|
||||
)
|
||||
if [[ "${(f)"$(tty)"##*/}" == "tty*" ]]; then
|
||||
_arguments \
|
||||
|
|
Loading…
Reference in a new issue