summaryrefslogtreecommitdiffstats
path: root/completions/ssh-add
diff options
context:
space:
mode:
Diffstat (limited to 'completions/ssh-add')
-rw-r--r--completions/ssh-add17
1 files changed, 15 insertions, 2 deletions
diff --git a/completions/ssh-add b/completions/ssh-add
index 23c73e0..0589972 100644
--- a/completions/ssh-add
+++ b/completions/ssh-add
@@ -10,6 +10,19 @@ _comp_cmd_ssh_add()
_comp_compgen -- -W 'md5 sha256'
return
;;
+ -*H)
+ _comp_compgen_filedir
+ return
+ ;;
+ -*h)
+ # TODO should we try supporting more types of constraints?
+ if [[ $cur == *@* ]]; then
+ _comp_complete_user_at_host "$@"
+ else
+ _comp_compgen_known_hosts -- "$cur"
+ fi
+ return
+ ;;
-*t)
return
;;
@@ -17,14 +30,14 @@ _comp_cmd_ssh_add()
_comp_compgen_filedir
return
;;
- -*[se])
+ -*S | -*[se])
_comp_compgen_filedir so
return
;;
esac
if [[ $cur == -* ]]; then
- _comp_compgen_help -- '-?'
+ _comp_compgen_usage -- '-?' || _comp_compgen_help -- '-?'
return
fi