2012-10-27 22:50:17 +02:00
|
|
|
# zsh completion for ponysay -*- shell-script -*-
|
2012-08-27 22:46:00 +02:00
|
|
|
#compdef ponysay ponythink
|
|
|
|
_opts=(
|
|
|
|
'(--version -v)'{-v,--version}'[Show version and exit]'
|
|
|
|
'(-h --help)'{-h,--help}'[Show this help and exit]'
|
|
|
|
'(-l --list)'{-l,--list}'[list pony names]'
|
|
|
|
'(-L --altlist)'{-L,--altlist}'[list pony names with alternatives]'
|
|
|
|
'(+l ++list)'{+l,++list}'[list extra pony names]'
|
|
|
|
'(+L ++altlist)'{+L,++altlist}'[list extra pony names with alternatives]'
|
|
|
|
'(-B --balloonlist)'{-B,--balloonlist}'[list balloon style names]'
|
|
|
|
'(-b --ballon)'{-b,--balloon}'[Selecy a balloon style]: :_path_files -W '/usr/share/ponysay/balloons' -g "*(\:r)"'
|
|
|
|
'(-c --compact)'{-c,--compat}'[Compress messages.]'
|
2012-10-27 22:50:17 +02:00
|
|
|
'(-W --wrap)'{-W,--wrap}'[The screen column where the message should be wrapped]' # TODO arguments `none` and `inherit` should be suggested
|
2012-05-12 02:19:59 +02:00
|
|
|
)
|
2012-08-27 22:46:00 +02:00
|
|
|
_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)"'
|
2012-10-28 03:35:02 +01:00
|
|
|
'(+f ++pony)'{+f,++pony}'[Select a extra pony]: :_path_files -W '/usr/share/ponysay/extrattyponies' -g "*(\:r)"'
|
2012-08-27 22:46:00 +02:00
|
|
|
)
|
|
|
|
_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)"'
|
2012-10-28 03:35:02 +01:00
|
|
|
'(+f ++pony)'{+f,++pony}'[Select a extra pony]: :_path_files -W '/usr/share/ponysay/extraponies' -g "*(\:r)"'
|
2012-08-27 22:46:00 +02:00
|
|
|
)
|
|
|
|
if [[ "${(f)"$(tty)"##*/}" == "tty*" ]]; then
|
|
|
|
_arguments \
|
|
|
|
"$_opts[@]" \
|
|
|
|
"$_tty_select[@]"
|
|
|
|
else
|
|
|
|
_arguments \
|
|
|
|
"$_opts[@]" \
|
|
|
|
"$_select[@]"
|
|
|
|
fi
|