Fix Zsh completions, define functions before calling them
This commit is contained in:
parent
e74efe64d6
commit
70c7643214
@ -1,13 +1,13 @@
|
||||
#compdef ssh-sign
|
||||
|
||||
_arguments '-f[key file]:filename:_files' '-n[namespace]:namespace:_ssh-sign_namespaces' '-h[short help text]' '*:file:_files'
|
||||
|
||||
function _ssh-sign_namespaces()
|
||||
{
|
||||
local -a namespaces=(file email git "@$(dnsdomainname)")
|
||||
_values "namespace" ${namespaces}
|
||||
}
|
||||
|
||||
_arguments '-f[key file]:filename:_files' '-n[namespace]:namespace:_ssh-sign_namespaces' '-h[short help text]' '*:file:_files'
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# End:
|
||||
|
@ -1,12 +1,5 @@
|
||||
#compdef translate
|
||||
|
||||
_arguments '-h[short help text]' \
|
||||
'--help[short help text]' \
|
||||
'--domain[domain of instance to use]:domain:_ssh_hosts' \
|
||||
'--from[Language to translate from]:language:_translate_languages' \
|
||||
'--to[Language to translate to]:language:_translate_languages' \
|
||||
'*:text:'
|
||||
|
||||
function _translate_languages()
|
||||
{
|
||||
local -a languages=($(curl -s https://libretranslate.de/languages \
|
||||
@ -14,6 +7,13 @@ function _translate_languages()
|
||||
_values "language" ${languages}
|
||||
}
|
||||
|
||||
_arguments '-h[short help text]' \
|
||||
'--help[short help text]' \
|
||||
'--domain[domain of instance to use]:domain:_ssh_hosts' \
|
||||
'--from[Language to translate from]:language:_translate_languages' \
|
||||
'--to[Language to translate to]:language:_translate_languages' \
|
||||
'*:text:'
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# End:
|
||||
|
Loading…
x
Reference in New Issue
Block a user