-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(validator): Decouple parser (#3645)
* fix(validate): Consistent conflict behavior We had two different implementations of conflicts - Validating conflicts - Allowing conflicts to override `required` - Missing members of a group conflicting with each other - Missing symmetric conflicts (A conflicts with B so B conflicts with A) This consolidates their implementations which should fix overriding of `required`. * fix(validate): Overrides always ignore required Before, if two arguments were required *and* overrode each other, then `cmd --opt=1 --other=2` succeded but `cmd --other=2` failed despite ignoring `--opt=1`. Requiring `--opt=1` to be present but unavailable doesn't help anyone and makes the behavior less predictable. Now both commands will have the same behavior. * refactor(parser): Pull out long-help determination This isn't a parser policy but command-level policy. * refactor(help): Make bool's meaning clearer * refactor(help): Consolidate help errors * refactor(help): Move help writing down a layer * refactor(parser): Parser is solely responsible for populating ArgMatches * refactor(validator): Decouple parser
- Loading branch information
Showing
8 changed files
with
251 additions
and
193 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.