-
Notifications
You must be signed in to change notification settings - Fork 362
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
required positional arguments and a vector positionals #306
Conversation
…arguments get small.
Codecov Report
@@ Coverage Diff @@
## master #306 +/- ##
==========================================
- Coverage 100% 99.93% -0.07%
==========================================
Files 12 12
Lines 2935 2954 +19
==========================================
+ Hits 2935 2952 +17
- Misses 0 2 +2
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #306 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 12 12
Lines 2935 2954 +19
=====================================
+ Hits 2935 2954 +19
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me - I was going to suggest adding a test for two ending positionals but you already have one. 👍 @kelvinhammond, @WenbinHou, does this look good to you? The positionals_at_end
setting is already there, this just modifies the way it works with an ending positional.
I will add that it will ONLY modify current operations if there are required positionals and the positionals_at_end flag is activated. |
Do we need the |
I think the biggest reason was to ensure the behavior worked and reduce potential ambiguities. If you didn't require positionals_at_end you could have regular arguments at the end of the args vector and the option would not trigger. I think if you removed that, you would add a bit of overhead for regular positionals and might be confusing sometimes why it wouldn't work, but otherwise in the cases tested it should work equivalently. Right now there is a specialized case in which the check occurs, and only a bool check overhead in other cases. It might be reasonable to expand it further but it might be worth considering clarifying and expanding desired rules for positional argument priority first. This topic also has some relationship with #297. |
So why this PR is not merged till now? |
I think we can go ahead and merge now, then address the "worth considering clarifying and expanding desired rules for positional argument priority first" as listed above. |
This PR adds a loop on the positional parsing to check for remaining required positionals and prioritizing them if positionals_at_end is activated.
it addresses issue #295