@@ -276,7 +276,7 @@ _comp_xfunc_ssh_identityfile()
276
276
local cur=$cur tmp
277
277
[[ ! $cur && -d ~ /.ssh ]] && cur=~ /.ssh/id
278
278
_comp_compgen -v tmp -c " $cur " filedir &&
279
- _comp_compgen -- -W ' "${tmp[@]}"' -X " ${1: +! } *.pub"
279
+ _comp_compgen -U tmp - - -W ' "${tmp[@]}"' -X " ${1: +! } *.pub"
280
280
}
281
281
282
282
_comp_deprecate_func 2.12 _ssh_identityfile _comp_xfunc_ssh_identityfile
@@ -460,35 +460,35 @@ _comp_xfunc_scp_remote_files()
460
460
# remove backslash escape from the first colon
461
461
cur=${cur/ \\ :/: }
462
462
463
- local userhost =${cur%% ?(\\ ):* }
464
- local path =${cur#*: }
463
+ local _userhost =${cur%% ?(\\ ):* }
464
+ local _path =${cur#*: }
465
465
466
466
# unescape (3 backslashes to 1 for chars we escaped)
467
467
# shellcheck disable=SC2090
468
- path =$( command sed -e ' s/\\\\\\\(' " $_comp_cmd_scp__path_esc " ' \)/\\\1/g' <<< " $path " )
468
+ _path =$( command sed -e ' s/\\\\\\\(' " $_comp_cmd_scp__path_esc " ' \)/\\\1/g' <<< " $_path " )
469
469
470
470
# default to home dir of specified user on remote host
471
- if [[ ! $path ]]; then
472
- path =$( ssh -o ' Batchmode yes' " $userhost " pwd 2> /dev/null)
471
+ if [[ ! $_path ]]; then
472
+ _path =$( ssh -o ' Batchmode yes' " $_userhost " pwd 2> /dev/null)
473
473
fi
474
474
475
- local files
475
+ local _files
476
476
if [[ ${1-} == -d ]]; then
477
477
# escape problematic characters; remove non-dirs
478
478
# shellcheck disable=SC2090
479
- files =$( ssh -o ' Batchmode yes' " $userhost " \
480
- command ls -aF1dL " $path *" 2> /dev/null |
479
+ _files =$( ssh -o ' Batchmode yes' " $_userhost " \
480
+ command ls -aF1dL " $_path *" 2> /dev/null |
481
481
command sed -e ' s/' " $_comp_cmd_scp__path_esc " ' /\\\\\\&/g' -e ' /[^\/]$/d' )
482
482
else
483
483
# escape problematic characters; remove executables, aliases, pipes
484
484
# and sockets; add space at end of file names
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 ' s/[*@|=]$//g' \
489
489
-e ' s/[^\/]$/& /g' )
490
490
fi
491
- _comp_split -la COMPREPLY " $files "
491
+ _comp_split -la COMPREPLY " $_files "
492
492
}
493
493
494
494
_comp_deprecate_func 2.12 _scp_remote_files _comp_xfunc_scp_remote_files
0 commit comments