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

Allow specification that positionals only occur at end #223

Merged
merged 1 commit into from
Feb 12, 2019

Conversation

phlptp
Copy link
Collaborator

@phlptp phlptp commented Feb 11, 2019

If merged this PR will add a flag option on Apps that specify that positional arguments only occur at the tail of the argument sequence.

.positionals_at_end()

Extra arguments after the first positional that are not captured by other positionals will generate an ExtrasError regardless of the state of allow_extras.

This closes #220

It works by triggering the equivalent of a -- after the first positional argument

…on some of the validators

Add a flag that specifies that positional options can only occur as the last arguments of a command line.  Will generate an ExtrasError if all positional arguments are not captured, regardless of the state of allow_extras.
@codecov
Copy link

codecov bot commented Feb 11, 2019

Codecov Report

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

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #223   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          12     12           
  Lines        2125   2133    +8     
=====================================
+ Hits         2125   2133    +8
Impacted Files Coverage Δ
include/CLI/App.hpp 100% <100%> (ø) ⬆️
include/CLI/Validators.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 f19b052...e132875. Read the comment docs.

1 similar comment
@codecov
Copy link

codecov bot commented Feb 11, 2019

Codecov Report

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

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #223   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          12     12           
  Lines        2125   2133    +8     
=====================================
+ Hits         2125   2133    +8
Impacted Files Coverage Δ
include/CLI/App.hpp 100% <100%> (ø) ⬆️
include/CLI/Validators.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 f19b052...e132875. Read the comment docs.

@henryiii henryiii merged commit 3d7de7d into CLIUtils:master Feb 12, 2019
@henryiii
Copy link
Collaborator

Looks great! Thanks!

@phlptp phlptp deleted the positionals_at_end branch February 12, 2019 15:37
@henryiii henryiii added this to the v1.8 milestone Feb 28, 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.

Is there a way to only parse options before positional arguments?
2 participants