Skip to content

Commit 05e70ed

Browse files
committed
fix(ssh): use _comp_compgen for _comp_xfunc_ssh_identityfile
1 parent 83f033f commit 05e70ed

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

completions/ssh

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -273,13 +273,10 @@ _comp_cmd_ssh__configfile()
273273
# shellcheck disable=SC2120
274274
_comp_xfunc_ssh_identityfile()
275275
{
276-
local cur=$cur
276+
local cur=$cur tmp
277277
[[ ! $cur && -d ~/.ssh ]] && cur=~/.ssh/id
278-
_comp_compgen -a filedir
279-
if ((${#COMPREPLY[@]} > 0)); then
280-
COMPREPLY=($(compgen -W '"${COMPREPLY[@]}"' \
281-
-X "${1:+!}*.pub" -- "$cur"))
282-
fi
278+
_comp_compgen -v tmp -c "$cur" filedir &&
279+
_comp_compgen -- -W '"${tmp[@]}"' -X "${1:+!}*.pub"
283280
}
284281

285282
_comp_deprecate_func 2.12 _ssh_identityfile _comp_xfunc_ssh_identityfile

0 commit comments

Comments
 (0)