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

add a function to get the remaining arguments in a valid order #265

Merged
merged 3 commits into from
Apr 28, 2019

Conversation

phlptp
Copy link
Collaborator

@phlptp phlptp commented Apr 17, 2019

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.

…rse. and add rvalue reference overloads for parse and _parse so args is not refilled if not needed.
@phlptp
Copy link
Collaborator Author

phlptp commented Apr 17, 2019

TODO:

  • Documentation
  • check coverage
  • add Example

@codecov
Copy link

codecov bot commented Apr 17, 2019

Codecov Report

Merging #265 into master will decrease coverage by 0.28%.
The diff coverage is 80%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
include/CLI/App.hpp 99.35% <80%> (-0.65%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 76d2cde...deb3ae5. Read the comment docs.

@codecov
Copy link

codecov bot commented Apr 17, 2019

Codecov Report

Merging #265 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #265   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          12     12           
  Lines        2737   2767   +30     
=====================================
+ Hits         2737   2767   +30
Impacted Files Coverage Δ
include/CLI/App.hpp 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 76d2cde...e999269. Read the comment docs.

@phlptp
Copy link
Collaborator Author

phlptp commented Apr 23, 2019

This also fixed a potential bug if the main app had a name and a subcommand terminator was used.

@henryiii
Copy link
Collaborator

Ready for review?

@phlptp
Copy link
Collaborator Author

phlptp commented Apr 23, 2019

yes

Copy link
Collaborator

@henryiii henryiii left a 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 .

@henryiii henryiii merged commit b1036a1 into CLIUtils:master Apr 28, 2019
@phlptp
Copy link
Collaborator Author

phlptp commented Apr 29, 2019

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.

@phlptp phlptp deleted the remaining_for_processing branch September 4, 2019 13:33
@henryiii henryiii added this to the v1.8 milestone Dec 31, 2019
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