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

Using an equal sign (or not) with an array option changes the value #368

Open
ehmicky opened this issue Feb 2, 2021 · 1 comment
Open
Labels

Comments

@ehmicky
Copy link

ehmicky commented Feb 2, 2021

When using the following code:

const yargs = require('yargs')
console.log(yargs.option('opt', { array: true }).parse().opt)

Using a = or not changes the parsed value, which is quite confusing:

$ node yargs.js --opt=""
[]

$ node yargs.js --opt ""
[ '' ]

Using yargs 16.2.0 on Node 15.6.0.

@bcoe bcoe transferred this issue from yargs/yargs Mar 26, 2021
@bcoe bcoe added the bug label Mar 26, 2021
@shadowspawn
Copy link
Member

Possibly related: #193

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

No branches or pull requests

3 participants