Skip to content

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

Merged
henryiii merged 3 commits into
CLIUtils:masterfrom
phlptp:remaining_for_processing
Apr 28, 2019
Merged

henryiii merged 3 commits into
CLIUtils:masterfrom
phlptp:remaining_for_processing

Conversation

@phlptp

@phlptp phlptp commented Apr 17, 2019

Copy link
Copy Markdown
Collaborator

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

phlptp commented Apr 17, 2019 •

Copy link
Copy Markdown
Collaborator Author

TODO:

  • Documentation
  • check coverage
  • add Example

@codecov

codecov Bot commented Apr 17, 2019

Copy link
Copy Markdown

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

codecov Bot commented Apr 17, 2019 •

Copy link
Copy Markdown

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

phlptp commented Apr 23, 2019

Copy link
Copy Markdown
Collaborator Author

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

@henryiii

Copy link
Copy Markdown
Collaborator

Ready for review?

@phlptp

phlptp commented Apr 23, 2019

Copy link
Copy Markdown
Collaborator Author

yes

@henryiii henryiii left a comment

Copy link
Copy Markdown
Collaborator

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

phlptp commented Apr 29, 2019

Copy link
Copy Markdown
Collaborator Author

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