Fix/positional args with underscore #128

Merged
merged 2 commits into from May 7, 2014

Projects

None yet

2 participants

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

jjmaestro added some commits Mar 1, 2014
@jjmaestro jjmaestro Test positional arguments with underscores d453d6f
@jjmaestro jjmaestro Fix for positional arguments with underscores
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 :)
a64aed8
@bitprophet bitprophet merged commit a64aed8 into pyinvoke:master May 7, 2014

1 check passed

default The Travis CI build passed
Details
@bitprophet bitprophet added a commit that referenced this pull request May 7, 2014
@bitprophet bitprophet Changelog re #128 5883ec6
@bitprophet
Member

Thanks! Good catch.

@jjmaestro
Contributor

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment