Minor improvement in cmdline.py (#6875)

This commit is contained in:
nakanoh 2025-06-09 19:07:01 +09:00 committed by GitHub
parent ba10dcfd1a
commit 6b5a4a6417
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 2 deletions

View File

@ -32,8 +32,9 @@ class ScrapyArgumentParser(argparse.ArgumentParser):
def _parse_optional(
self, arg_string: str
) -> tuple[argparse.Action | None, str, str | None] | None:
# if starts with -: it means that is a parameter not a argument
if arg_string[:2] == "-:":
# Support something like -o -:json, where -:json is a value for
# -o, not another parameter.
if arg_string.startswith("-:"):
return None
return super()._parse_optional(arg_string)