Skip to content

Fix/positional args with underscore #128

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

Merged

Conversation

jjmaestro
Copy link
Contributor

This should fix issue #122

Positional arguments with underscores are flagged as positional by storing the name with the underscore in a list. However, the flag is set somewhere else in the code, where the underscore has been replaced for a dash. Hence, the positional test fails and the task argument is left in a weird limbo of not being neither positional nor optional. Also, the argument was getting the default value for positional arguments (None).

Positional arguments with underscores are flagged as positional by storing the
name *with* the underscore in a list. However, the flag is set somewhere else
in the code, where the underscore has been replaced for a dash. Hence, the
positional test fails and the task argument is left in a weird limbo of not
being neither positional nor optional.

The fix is easy: simply move the positional and optional tests to before the
name change happens :)
@bitprophet bitprophet merged commit a64aed8 into pyinvoke:master May 7, 2014
bitprophet added a commit that referenced this pull request May 7, 2014
@bitprophet
Copy link
Member

Thanks! Good catch.

@jjmaestro
Copy link
Contributor Author

👍

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

Successfully merging this pull request may close these issues.

2 participants