ssh kitten: handle --

This commit is contained in:
Kovid Goyal 2021-07-22 17:03:47 +05:30
parent 13fc921fa5
commit 9c28a1ba31
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -182,8 +182,9 @@ def parse_ssh_args(args: List[str]) -> Tuple[List[str], List[str], bool]:
server_args: List[str] = []
expecting_option_val = False
passthrough = False
stop_option_processing = False
for arg in args:
if len(server_args) > 1:
if len(server_args) > 1 or stop_option_processing:
server_args.append(arg)
continue
if arg.startswith('-') and not expecting_option_val:
@ -203,6 +204,9 @@ def parse_ssh_args(args: List[str]) -> Tuple[List[str], List[str], bool]:
else:
expecting_option_val = True
break
if arg == '--':
stop_option_processing = True
continue
raise SystemExit('Unknown option: {}'.format(arg))
continue
if expecting_option_val: