-
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
add a function to get the remaining arguments in a valid order #265
Conversation
…rse. and add rvalue reference overloads for parse and _parse so args is not refilled if not needed.
TODO:
|
Codecov Report
@@ Coverage Diff @@
## master #265 +/- ##
==========================================
- Coverage 100% 99.71% -0.29%
==========================================
Files 12 12
Lines 2737 2775 +38
==========================================
+ Hits 2737 2767 +30
- Misses 0 8 +8
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #265 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 12 12
Lines 2737 2767 +30
=====================================
+ Hits 2737 2767 +30
Continue to review full report at Codecov.
|
…ector) remove impossible to reach branches in _parse function
This also fixed a potential bug if the main app had a name and a subcommand terminator was used. |
Ready for review? |
yes |
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.
I think the name is okay, it's at least easy to find if one looks for it. I would be tempted to suggest some sort of templating on the parse function, but this is better for something like the worked planned for #194 .
I thought about making it a template, I also thought about making the parse take a const ref to a vector but then forcing the one that doesn't modify becomes a little more awkward. So I wasn't entirely clear what the best method of dealing with this was. In any case the main reason was so you could call parse(app.remaining_for_passthough()) without the compiler getting mad at you. |
See issue #264
This adds function remaining_for_passthrough() --> different name suggestions are welcome!
It also adds some overloads with rvalue references so parse can take the function directly when used in a cascade fashion, and not do extra work or generate warnings when used. The parse from string and (argc, argv) also use this overload since the args can't be used any further.