Skip to content

Commit 757045a

Browse files
committed
feat(ssh-add): (non-)complete -H, -h, and -S arguments
1 parent a3e8a5e commit 757045a

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

completions/ssh-add

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,27 @@ _comp_cmd_ssh_add()
1010
_comp_compgen -- -W 'md5 sha256'
1111
return
1212
;;
13+
-*H)
14+
_comp_compgen_filedir
15+
return
16+
;;
17+
-*h)
18+
# TODO should we try supporting more types of constraints?
19+
if [[ $cur == *@* ]]; then
20+
_comp_complete_user_at_host "$@"
21+
else
22+
_comp_compgen_known_hosts -- "$cur"
23+
fi
24+
return
25+
;;
1326
-*t)
1427
return
1528
;;
1629
-*T)
1730
_comp_compgen_filedir
1831
return
1932
;;
20-
-*[se])
33+
-*S | -*[se])
2134
_comp_compgen_filedir so
2235
return
2336
;;

0 commit comments

Comments
 (0)