ssh kitten: Allow completion of ssh options between the destination and command
This contravenes the documented command line parsing behavior of ssh but matches its actual implementation. Sigh. Fixes #5322
This commit is contained in:
parent
e3a4150fea
commit
e2117ee8a4
@ -87,6 +87,8 @@ Detailed list of changes
|
||||
- Allow showing the working directory of the active window in tab titles
|
||||
(:pull:`5314`)
|
||||
|
||||
- ssh kitten: Allow completion of ssh options between the destination and command (:iss:`5322`)
|
||||
|
||||
|
||||
0.25.2 [2022-06-07]
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@ -291,6 +291,7 @@ def complete_option(ans: Completions, prefix: str = '-') -> None:
|
||||
def complete(ans: Completions, words: Sequence[str], new_word: bool) -> None:
|
||||
options = ssh_options()
|
||||
expecting_arg = False
|
||||
seen_destination = False
|
||||
types = ['' for i in range(len(words))]
|
||||
for i, word in enumerate(words):
|
||||
if expecting_arg:
|
||||
@ -302,8 +303,10 @@ def complete(ans: Completions, words: Sequence[str], new_word: bool) -> None:
|
||||
if len(word) == 2 and options.get(word[1]):
|
||||
expecting_arg = True
|
||||
continue
|
||||
if seen_destination:
|
||||
break
|
||||
types[i] = 'destination'
|
||||
break
|
||||
seen_destination = True
|
||||
if new_word:
|
||||
if words:
|
||||
if expecting_arg:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user