Skip to content

Commit 50865aa

Browse files
authored
Merge pull request #1152 from scop/feat/ssh-add-improvements
feat: ssh-add improvements
2 parents 39ea543 + 2beb012 commit 50865aa

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

completions/ssh-add

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,34 @@ _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
;;
2437
esac
2538

2639
if [[ $cur == -* ]]; then
27-
_comp_compgen_help -- '-?'
40+
_comp_compgen_usage -- '-?' || _comp_compgen_help -- '-?'
2841
return
2942
fi
3043

0 commit comments

Comments
 (0)