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

Extras handling refactor #37

Merged
merged 6 commits into from
Nov 19, 2017
Merged

Extras handling refactor #37

merged 6 commits into from
Nov 19, 2017

Conversation

henryiii
Copy link
Collaborator

In the interests of solving #36, this PR refactors the way extras are handled. The implementation:

  • parse no longer returns a vector (not well supported anyway, for example with CLI11_PARSE
  • Added remaining() and remaining_size(), which provide access into the unparsed options. They support a "recurse" bool flag that causes them to collect all subcommand arguments, too. They are not "reversed".
  • allow_extras and prefix_command are now valid on subcommands, and inherit the setting from the parent upon creation (like the other options)

Oddities that remain:

  • The vector form of parse still expects a "reversed" vector; it updates itself with the remaining options, however. Reordering might be unintentionally possible with multiple subcommands.

Will need to maybe add more tests, and needs docs and changelog.

@codecov
Copy link

codecov bot commented Nov 16, 2017

Codecov Report

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

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #37   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           9      9           
  Lines        1141   1149    +8     
  Branches      233    237    +4     
=====================================
+ Hits         1141   1149    +8
Impacted Files Coverage Δ
include/CLI/Option.hpp 100% <ø> (ø) ⬆️
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 3de7832...e94d465. Read the comment docs.

@henryiii
Copy link
Collaborator Author

@lambdafu , let me know how this works (and maybe the other two PRs, too) :)

@henryiii henryiii merged commit 1b02682 into master Nov 19, 2017
@henryiii henryiii deleted the extras branch November 19, 2017 20:19
@lambdafu
Copy link
Contributor

Looks good! I'll implement this in a larger program and see if there are any issues remaining. Thanks!

@henryiii henryiii added this to the v1.3 milestone Nov 22, 2017
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