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

nargs-eats-options doesn't work with array options #254

Open
vadim-galeev opened this issue Mar 3, 2020 · 1 comment
Open

nargs-eats-options doesn't work with array options #254

vadim-galeev opened this issue Mar 3, 2020 · 1 comment

Comments

@vadim-galeev
Copy link

vadim-galeev commented Mar 3, 2020

Firstly, nargs didn't consume dashed arguments since version 9.0.0. So, issue #232 was opened, and new configuration option, nargs-eats-options, was added (thanks to @bcoe).
By now, after the fix, nargs-eats-option works well with one-value options but still doesn't work with options which are considered as arrays.
For example, --foo is an array option (and nargs is set to 1):
--foo -apple --foo banana -foo cat
is not parsed correctly even with nargs-eats-option=true .
Expected result is: foo: [ '-apple', 'banana', 'cat' ].
Actual result is: foo: ['banana', 'cat' ].

And this works correct in version 8.1.0, result is foo: [ '-apple', 'banana', 'cat' ] as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants