Skip to content

Positional argument checks - #262

Merged
henryiii merged 5 commits into
CLIUtils:masterfrom
phlptp:Positional_argument_checks
Apr 11, 2019
Merged

henryiii merged 5 commits into
CLIUtils:masterfrom
phlptp:Positional_argument_checks

Conversation

@phlptp

@phlptp phlptp commented Mar 30, 2019

Copy link
Copy Markdown
Collaborator

If merged this PR will add an option to require positional arguments to pass validation before matching. This would allow creating positionals for a file and number and allowing them to be entered in any order on the command line.

Modifications include adding validate_positionals function on App
moving the _validate code into a separate function in options.
removing the set_results function in options which was being used by config file functions but it was bypassing some of the result processing, which could cause some issues if the delimiter option was also being used.

Also tweaked the template for add_option to separate out the lexical_cast type from the assignment type if desired. (Probably need a few more tests of this yet).

@codecov

codecov Bot commented Mar 30, 2019

Copy link
Copy Markdown

Codecov Report

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

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #262   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          12     12           
  Lines        2710   2739   +29     
=====================================
+ Hits         2710   2739   +29
Impacted Files Coverage Δ
include/CLI/Option.hpp 100% <100%> (ø) ⬆️
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 6be9f0c...f04ce3c. Read the comment docs.

@codecov

codecov Bot commented Mar 30, 2019 •

Copy link
Copy Markdown

Codecov Report

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

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #262   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          12     12           
  Lines        2710   2737   +27     
=====================================
+ Hits         2710   2737   +27
Impacted Files Coverage Δ
include/CLI/Option.hpp 100% <100%> (ø) ⬆️
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 a1c18e0...640020c. Read the comment docs.

@henryiii

henryiii commented Apr 4, 2019

Copy link
Copy Markdown
Collaborator

@phlptp, can you fix the conflict? I’ll be back from yet another conference on Tuesday.

@phlptp
phlptp force-pushed the Positional_argument_checks branch from f04ce3c to c28f81a Compare April 4, 2019 21:36
@henryiii
henryiii merged commit 76d2cde into CLIUtils:master Apr 11, 2019
@phlptp phlptp mentioned this pull request Aug 19, 2019
@phlptp
phlptp deleted the Positional_argument_checks branch September 4, 2019 13:34
@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