Skip to content

Commit bbd773b

Browse files
committed
style(ssh): sort options the same as in ssh's usage message
So that they're easier to sync.
1 parent e29517d commit bbd773b

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

completions/ssh

+8-5
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,8 @@ _ssh()
263263

264264
local ipvx
265265

266+
# Keep cases sorted the same they're in ssh's usage message
267+
# (but do group ones with same arg completion)
266268
case $prev in
267269
-*b)
268270
_ip_addresses
@@ -279,14 +281,14 @@ _ssh()
279281
_filedir
280282
return
281283
;;
282-
-*i)
283-
_ssh_identityfile
284-
return
285-
;;
286284
-*I)
287285
_filedir so
288286
return
289287
;;
288+
-*i)
289+
_ssh_identityfile
290+
return
291+
;;
290292
-*J)
291293
_known_hosts_real -a ${configfile:+-F "$configfile"} -- "$cur"
292294
return
@@ -333,7 +335,8 @@ _ssh()
333335
COMPREPLY=($(compgen -W '$(_parse_usage "$1")' -- "$cur"))
334336
else
335337
local args
336-
_count_args "=" "-*[bcDeLpRWEFSiIJlmOoQw]"
338+
# Keep glob sort in sync with cases above
339+
_count_args "=" "-*[bcDeLpRWEFSIiJlmOoQw]"
337340
if ((args > 1)); then
338341
compopt -o filenames
339342
COMPREPLY+=($(compgen -c -- "$cur"))

0 commit comments

Comments
 (0)