Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
costis-t opened this issue Mar 6, 2022 · 0 comments
Open

Comments

@costis-t
Copy link

costis-t commented Mar 6, 2022

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant