1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-21 18:22:30 +01:00

[options] fix passing negative numbers as arguments (#5262)

https://github.com/mikf/gallery-dl/issues/5262#issuecomment-2468677453

fixes regression introduced in 9e729681

'argparse' sets a flag and changes its behavior when using something
that looks like a negative number as option string, '-4' and '-6' in
this case.
This commit is contained in:
Mike Fährmann 2024-11-11 19:07:37 +01:00
parent 30ff775382
commit cd6d6ea8be
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -803,4 +803,10 @@ def build_parser():
"&& convert * ../doc.pdf\""),
)
try:
# restore normal behavior when adding '-4' or '-6' as arguments
parser._has_negative_number_optionals.clear()
except Exception:
pass
return parser