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

--option=--value is wrongly parsed when option is an array or has narg set #261

Closed
mleguen opened this issue Mar 26, 2020 · 1 comment · Fixed by #262
Closed

--option=--value is wrongly parsed when option is an array or has narg set #261

mleguen opened this issue Mar 26, 2020 · 1 comment · Fixed by #262
Labels

Comments

@mleguen
Copy link
Member

mleguen commented Mar 26, 2020

const parse = require('yargs-parser')
console.log(parse('--option=--value'))

returns, as expected:

{ _: [], option: '--value' }

However:

const parse = require('yargs-parser')
console.log(parse('--option=--value', {
  array: ['option']
}))

returns:

{ _: [], option: [], value: true }

when it would be expected to return:

{ _: [], option: [ '--value' ] }

Same issue with narg: { option: 1 }.

nargs-eats-options does not change anything to this behavior.

@mleguen
Copy link
Member Author

mleguen commented Mar 26, 2020

Similar issue with --option=-value too.

mleguen pushed a commit that referenced this issue Mar 26, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
mleguen pushed a commit that referenced this issue Mar 26, 2020
@bcoe bcoe closed this as completed in #262 Mar 26, 2020
ghost pushed a commit to EU-EDPS/website-evidence-collector that referenced this issue Apr 1, 2020
to get bugfix yargs/yargs-parser#261 for 
`--browser-options` starting with double dash `--`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant