Skip to content

Abnormal exit when empty string is passed to uncurl.parse_context() #49

@costis-t

Description

@costis-t

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

parsed_args = parser.parse_args(tokens)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions