You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Specifying both count and boolean should throw error #216
As discussed in yargs/yargs#256, specifying both count and boolean is a programming error. yargs should throw an exception, or at the very least print a warning. If printing a warning is chosen, the default count should be 0 instead of 2 (as is currently the case).
@hildjj@plroebuck let's start by printing a warning if you use two mutually exclusive options in yargs ... this will encourage folks to stop doing so, but will allow us to release the update without it being a breaking change.
I bet there are a few other combinations of options we could come up with that shouldn't be possible in conjunction, so we should try to write this warning mechanism in a way that's easy to sprinkle throughout the codebase.
I would love help working on this issue, if either of you are interested?
Activity
plroebuck commentedon Feb 26, 2018
This is still broken as of yargs-v11.0.0.
Should throw an exception if
.boolean()method is used with.count()for the same option.bcoe commentedon Mar 4, 2018
@hildjj @plroebuck let's start by printing a warning if you use two mutually exclusive options in yargs ... this will encourage folks to stop doing so, but will allow us to release the update without it being a breaking change.
I bet there are a few other combinations of options we could come up with that shouldn't be possible in conjunction, so we should try to write this warning mechanism in a way that's easy to sprinkle throughout the codebase.
I would love help working on this issue, if either of you are interested?
bcoe commentedon Nov 9, 2019
@juergba has been starting to add some of this validation logic, see:
#191