File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -332,13 +332,14 @@ _ssh()
332
332
elif [[ $cur == -* ]]; then
333
333
COMPREPLY=($( compgen -W ' $(_parse_usage "$1")' -- " $cur " ) )
334
334
else
335
- _known_hosts_real ${ipvx-} -a ${configfile: +-F " $configfile " } -- " $cur "
336
-
337
335
local args
338
336
_count_args " =" " -*[bcDeLpRWEFSiIJlmOoQw]"
339
337
if (( args > 1 )) ; then
340
338
compopt -o filenames
341
339
COMPREPLY+=($( compgen -c -- " $cur " ) )
340
+ else
341
+ _known_hosts_real ${ipvx-} -a ${configfile: +-F " $configfile " } \
342
+ -- " $cur "
342
343
fi
343
344
fi
344
345
} &&
Original file line number Diff line number Diff line change @@ -10,8 +10,12 @@ def test_1(self, completion):
10
10
11
11
@pytest .mark .complete ("ssh -F config ls" , cwd = "ssh" )
12
12
def test_2 (self , completion ):
13
- """Should complete both commands and hostname."""
14
- assert all (x in completion for x in "ls ls_known_host" .split ())
13
+ """
14
+ Should not complete commands when host is not specified.
15
+
16
+ Test sanity assumes there are commands starting with `ls`.
17
+ """
18
+ assert completion == "_known_host"
15
19
16
20
@pytest .mark .complete ("ssh bash" , cwd = "ssh" )
17
21
def test_3 (self , completion ):
You can’t perform that action at this time.
0 commit comments