@@ -8,7 +8,7 @@ _comp_cmd_ssh__compgen_queries()
8
8
key-plain key-sig protocol-version compression sig ciphers macs
9
9
kexalgorithms pubkeyacceptedkeytypes hostkeyalgorithms
10
10
hostbasedkeytypes hostbasedacceptedkeytypes)
11
- _comp_compgen -c " ${cur,,} " -- -W ' "${ret[@]}" help"'
11
+ _comp_compgen -c " ${cur,,} " -U ret - - -W ' "${ret[@]}" help"'
12
12
}
13
13
14
14
# @since 2.12
@@ -37,7 +37,7 @@ _comp_cmd_ssh__compgen_ciphers()
37
37
[[ ${ret-} ]] || ret=(3des-cbc aes128-cbc aes192-cbc aes256-cbc
38
38
aes128-ctr aes192-ctr aes256-ctr arcfour128 arcfour256 arcfour
39
39
blowfish-cbc cast128-cbc)
40
- _comp_compgen -- -W ' "${ret[@]}"'
40
+ _comp_compgen -U ret - - -W ' "${ret[@]}"'
41
41
}
42
42
43
43
_comp_cmd_ssh__compgen_macs ()
@@ -46,7 +46,7 @@ _comp_cmd_ssh__compgen_macs()
46
46
_comp_compgen -v ret -i ssh query " $1 " mac
47
47
[[
${ret-} ]]
|| ret=(hmac-md5 hmac-sha1
[email protected]
48
48
hmac-ripemd160 hmac-sha1-96 hmac-md5-96)
49
- _comp_compgen -- -W ' "${ret[@]}"'
49
+ _comp_compgen -U ret - - -W ' "${ret[@]}"'
50
50
}
51
51
52
52
# @since 2.12
@@ -283,7 +283,7 @@ _comp_xfunc_ssh_compgen_identityfile()
283
283
local cur=$cur tmp
284
284
[[ ! $cur && -d ~ /.ssh ]] && cur=~ /.ssh/id
285
285
_comp_compgen -v tmp -c " $cur " filedir &&
286
- _comp_compgen -- -W ' "${tmp[@]}"' -X " ${1: +! } *.pub"
286
+ _comp_compgen -U tmp - - -W ' "${tmp[@]}"' -X " ${1: +! } *.pub"
287
287
}
288
288
289
289
_comp_deprecate_func 2.12 _ssh_identityfile _comp_xfunc_ssh_compgen_identityfile
@@ -467,35 +467,35 @@ _comp_xfunc_scp_compgen_remote_files()
467
467
# remove backslash escape from the first colon
468
468
cur=${cur/ \\ :/: }
469
469
470
- local userhost =${cur%% ?(\\ ):* }
471
- local path =${cur#*: }
470
+ local _userhost =${cur%% ?(\\ ):* }
471
+ local _path =${cur#*: }
472
472
473
473
# unescape (3 backslashes to 1 for chars we escaped)
474
474
# shellcheck disable=SC2090
475
- path =$( command sed -e ' s/\\\\\\\(' " $_comp_cmd_scp__path_esc " ' \)/\\\1/g' <<< " $path " )
475
+ _path =$( command sed -e ' s/\\\\\\\(' " $_comp_cmd_scp__path_esc " ' \)/\\\1/g' <<< " $_path " )
476
476
477
477
# default to home dir of specified user on remote host
478
- if [[ ! $path ]]; then
479
- path =$( ssh -o ' Batchmode yes' " $userhost " pwd 2> /dev/null)
478
+ if [[ ! $_path ]]; then
479
+ _path =$( ssh -o ' Batchmode yes' " $_userhost " pwd 2> /dev/null)
480
480
fi
481
481
482
- local files
482
+ local _files
483
483
if [[ ${1-} == -d ]]; then
484
484
# escape problematic characters; remove non-dirs
485
485
# shellcheck disable=SC2090
486
- files =$( ssh -o ' Batchmode yes' " $userhost " \
487
- command ls -aF1dL " $path *" 2> /dev/null |
486
+ _files =$( ssh -o ' Batchmode yes' " $_userhost " \
487
+ command ls -aF1dL " $_path *" 2> /dev/null |
488
488
command sed -e ' s/' " $_comp_cmd_scp__path_esc " ' /\\\\\\&/g' -e ' /[^\/]$/d' )
489
489
else
490
490
# escape problematic characters; remove executables, aliases, pipes
491
491
# and sockets; add space at end of file names
492
492
# shellcheck disable=SC2090
493
- files =$( ssh -o ' Batchmode yes' " $userhost " \
494
- command ls -aF1dL " $path *" 2> /dev/null |
493
+ _files =$( ssh -o ' Batchmode yes' " $_userhost " \
494
+ command ls -aF1dL " $_path *" 2> /dev/null |
495
495
command sed -e ' s/' " $_comp_cmd_scp__path_esc " ' /\\\\\\&/g' -e ' s/[*@|=]$//g' \
496
496
-e ' s/[^\/]$/& /g' )
497
497
fi
498
- _comp_split -l COMPREPLY " $files "
498
+ _comp_compgen_split -l -- " $_files "
499
499
}
500
500
501
501
# @deprecated 2.12 use `_comp_compgen -ax ssh remote_files` instead
0 commit comments