uncurl
uncurl copied to clipboard
Abnormal exit when empty string is passed to uncurl.parse_context()
When an empty string (curl_command = '') is passed to uncurl.parse_context(curl_command) a python script ends abnormally showing this error:
usage: [-h] [-d DATA] [-b DATA_BINARY] [-X X] [-H HEADER] [--compressed] [-k] [--user USER] [-i] [-s] command url
: error: the following arguments are required: command, url
The abnormal termination could be fixed with something like
try:
parsed_args = parser.parse_args(tokens)
except:
pass
in https://github.com/spulec/uncurl/blob/16d0568b7c2d1bd427a524f00764bab3c954bcd0/uncurl/api.py#L36