Skip to content

Commit 73d8304

Browse files
committed
ssh: make -o protocol completion less hardcoded
No longer supports any comma separation though.
1 parent 0984db6 commit 73d8304

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

completions/ssh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,11 @@ _ssh_suboption()
141141
keyboard-interactive password' -- "$cur") )
142142
;;
143143
protocol)
144-
COMPREPLY=( $(compgen -W '1 2 1,2 2,1' -- "$cur") )
144+
local protocols=( $(_ssh_query "$2" protocol-version) )
145+
[[ $protocols ]] || protocols=(1 2)
146+
if [[ ${#protocols[@]} -gt 1 ]]; then
147+
COMPREPLY=( $(compgen -W '${protocols[@]}' -- "$cur") )
148+
fi
145149
;;
146150
proxyjump)
147151
_known_hosts_real -a -F "$configfile" -- "$cur"

0 commit comments

Comments
 (0)