Conversation
Codecov Report
@@ Coverage Diff @@
## master #51 +/- ##
==========================================
- Coverage 99.67% 99.59% -0.08%
==========================================
Files 9 9
Lines 1241 1249 +8
Branches 251 252 +1
==========================================
+ Hits 1237 1244 +7
- Misses 4 5 +1
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #51 +/- ##
==========================================
+ Coverage 99.6% 99.76% +0.16%
==========================================
Files 9 9
Lines 1256 1289 +33
Branches 252 257 +5
==========================================
+ Hits 1251 1286 +35
+ Misses 5 3 -2
Continue to review full report at Codecov.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The old
required_subcommandhad several issues. This PR fixes those with a more thoughtful solution. The range of allowed subcommands can now be explicitly set, and CLI11 finally stops trying to match subcommands after the max number allowed is obtained. The changes:require_subcommandnow has a two-argument form, with min and max. Setting max to 0 means unlimited subcommands.RequiredErrorif you have too many subcommands.-1to set the default once. It only affects subcommands that have subcommands, obviously.I've left
.require_subcommand()as setting 1 or more, though 1 might be better; I did that because 1 is intuitive for someone requiring 1 subcommand, and 1 or more is not obtainable with a single argument otherwise (and is rather undiscoverable as.require_subcommand(1,0)).As part of the extended testing, I've reduced the "grabbyness" of the unlimited argument options. They now no longer eat up options if positionals remain (including unlimited positionals).