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

Fix/positional args with underscore #128

Merged

Conversation

@jjmaestro
Copy link
Contributor

@jjmaestro jjmaestro commented Mar 1, 2014

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).

jjmaestro added 2 commits Mar 1, 2014
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
1 check passed
1 check passed
default The Travis CI build passed
Details
bitprophet added a commit that referenced this pull request May 7, 2014
@bitprophet
Copy link
Member

@bitprophet bitprophet commented May 7, 2014

Thanks! Good catch.

@jjmaestro
Copy link
Contributor Author

@jjmaestro jjmaestro commented Jun 18, 2014

👍

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

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.