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
Regression: 15.2.0 ignores nargs for array #1570
Comments
My thinking on this regression is that using I will look at adding this behavior back to
In general I'm not happy with array parsing, and would like to move towards arrays not being "greedy" by default, see: https://github.com/yargs/yargs-parser#greedy-arrays Instead I would rather the default behavior is closer to what you're describing, mainly If we have this, I'm honestly tempted to drop the |
Thanks for the detailed explanation @bcoe! Sounds great. Setting Feel free to close this issue as you see fit. |
@kevinoid I'm working on a fix right now, the problem with my wanting to drop I had an idea I'm working on, if we make it set |
I'm not sure I understand. Why does setting |
@kevinoid we switched the parsing order to parse If |
Gotcha. Thanks @bcoe! |
@kevinoid can I bother you one more time to try |
Sure thing. In my testing |
Fixed in latest version. |
To avoid a regression in 15.2.0 related to array+nargs for parsing -H. See yargs/yargs#1570. Fixes: #71 Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
Yargs 15.2.0 included an incompatible change in how
nargs
is handled forarray
options. For example, code for a repeatable option where the option should have a single argument on each occurrence (e.g. to behave likecurl
's--header
option):When invoked as
./example.js --header foo bar
withyargs@15.1.0
this would print:with
yargs@15.2.0
this would print:I bisected the change to b9409da (#1553) then to yargs/yargs-parser@4cbc188 as a result of #1098. I'm not sure if this is a bug in
yargs-parser
or if this is the intended behavior (in which case it might warrant a major version bump and some guidance about how to get the previous behavior).Thanks for considering,
Kevin
The text was updated successfully, but these errors were encountered: