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

feat!: NaN can now be provided as a value for nargs, indicating "at least" one value is expected for array #251

Merged
merged 1 commit into from Mar 2, 2020

Conversation

bcoe
Copy link
Member

@bcoe bcoe commented Mar 2, 2020

Introduces special handling of NaN, which yargs will use rather than 1 to indicate that
an argument has a required value following the flag.

BREAKING CHANGE: the narg count is now enforced when parsing arrays.


This is in reaction to mochajs/mocha#4196, yargs/yargs#1098, and yargs/yargs#1570. It will eliminate ambiguity in requiresArg vs., nargs = , by moving requiresArg to using the special NaN value for nargs.

Introduces special handling of NaN, which yargs will use rather than 1 to indicate that
an argument has a required value following the flag.

BREAKING CHANGE: the narg count is now enforced when parsing arrays.
@bcoe bcoe changed the title feat!: further refine how nargs and array behave in conjunction feat!: NaN can now be provided as a value for nargs, indicating "at least" one value is expected Mar 2, 2020
@bcoe bcoe changed the title feat!: NaN can now be provided as a value for nargs, indicating "at least" one value is expected feat!: NaN can now be provided as a value for nargs, indicating "at least" one value is expected for array Mar 2, 2020
@bcoe bcoe merged commit 9db4be8 into master Mar 2, 2020
@bcoe bcoe deleted the nargs-array branch March 2, 2020 05:39
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.

None yet

1 participant