@@ -50,11 +50,10 @@ _comp_cmd_ssh__compgen_macs()
5050}
5151
5252# @since 2.12
53- # TODO:API: make it a generator
54- _comp_xfunc_ssh_options ()
53+ _comp_xfunc_ssh_compgen_options ()
5554{
5655 # curl --silent https://raw.githubusercontent.com/openssh/openssh-portable/master/ssh_config.5 | awk '$1==".It" && $2=="Cm" && $3!="Host" && $3!="Match" {print " "$3}' | sort
57- local opts =(
56+ local _opts =(
5857 AddKeysToAgent AddressFamily BatchMode BindAddress BindInterface
5958 CanonicalDomains CanonicalizeFallbackLocal CanonicalizeHostname
6059 CanonicalizeMaxDots CanonicalizePermittedCNAMEs CASignatureAlgorithms
@@ -80,28 +79,29 @@ _comp_xfunc_ssh_options()
8079 UserKnownHostsFile VerifyHostKeyDNS VisualHostKey XAuthLocation
8180 )
8281 # Selected old ones
83- opts +=(
82+ _opts +=(
8483 GSSAPIKeyExchange GSSAPIRenewalForcesRekey GSSAPIServerIdentity
8584 GSSAPITrustDns PubkeyAcceptedKeyTypes SmartcardDevice UsePrivilegedPort
8685 )
8786 local -a protocols
8887 _comp_compgen -v protocols -i ssh query ssh protocol-version
8988 if [[ ${protocols[*]-} == * 1* ]]; then
90- opts +=(Cipher CompressionLevel Protocol RhostsRSAAuthentication
89+ _opts +=(Cipher CompressionLevel Protocol RhostsRSAAuthentication
9190 RSAAuthentication)
9291 fi
92+ _comp_unlocal protocols
9393
9494 compopt -o nospace
95- local IFS= $' \t\n ' reset= $( shopt -p nocasematch )
96- shopt -s nocasematch
97- local option
98- COMPREPLY=( $( for option in " ${opts [@]} " ; do
99- [[ $option == " $cur " * ]] && printf ' %s=\n' " $option "
100- done) )
101- $reset
95+ _comp_compgen_split -l -- " $(
96+ shopt -s nocasematch
97+ local option
98+ for option in " ${_opts [@]} " ; do
99+ [[ $option == " $cur " * ]] && printf ' %s=\n' " $option "
100+ done
101+ ) "
102102}
103103
104- _comp_deprecate_func 2.12 _ssh_options _comp_xfunc_ssh_options
104+ _comp_deprecate_func 2.12 _ssh_options _comp_xfunc_ssh_compgen_options
105105
106106# Complete a ssh suboption (like ForwardAgent=y<tab>)
107107# @param $1 the ssh executable to invoke
@@ -351,7 +351,7 @@ _comp_cmd_ssh()
351351 return
352352 ;;
353353 -* o)
354- _comp_xfunc_ssh_options " $1 "
354+ _comp_xfunc_ssh_compgen_options " $1 "
355355 return
356356 ;;
357357 -* Q)
@@ -431,7 +431,7 @@ _comp_cmd_sftp()
431431 return
432432 ;;
433433 -* o)
434- _comp_xfunc_ssh_options
434+ _comp_xfunc_ssh_compgen_options
435435 return
436436 ;;
437437 -* S)
@@ -585,7 +585,7 @@ _comp_cmd_scp()
585585 return
586586 ;;
587587 -* o)
588- _comp_xfunc_ssh_options
588+ _comp_xfunc_ssh_compgen_options
589589 return
590590 ;;
591591 -* S)
0 commit comments