summaryrefslogtreecommitdiff
path: root/completions/ssh-keygen
diff options
context:
space:
mode:
Diffstat (limited to 'completions/ssh-keygen')
-rw-r--r--completions/ssh-keygen7
1 files changed, 6 insertions, 1 deletions
diff --git a/completions/ssh-keygen b/completions/ssh-keygen
index 5c449fc0..36fa2cad 100644
--- a/completions/ssh-keygen
+++ b/completions/ssh-keygen
@@ -42,7 +42,12 @@ _ssh_keygen()
return
;;
-*t)
- COMPREPLY=( $(compgen -W 'dsa ecdsa ed25519 rsa rsa1' -- "$cur") )
+ local protocols=$(_xfunc ssh _ssh_query "$1" protocol-version)
+ local types='dsa ecdsa ed25519 rsa'
+ if [[ $protocols == *1* ]]; then
+ types+=' rsa1'
+ fi
+ COMPREPLY=( $(compgen -W "$types" -- "$cur") )
return
;;
esac