mirror of https://github.com/scrapy/scrapy.git
Minor improvement in cmdline.py (#6875)
This commit is contained in:
parent
ba10dcfd1a
commit
6b5a4a6417
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue