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

wrong behavior when flatten-duplicate-arrays and duplicate-arguments-array are enabled #74

Closed
bcoe opened this issue Dec 1, 2016 · 0 comments · Fixed by #75
Closed
Labels

Comments

@bcoe
Copy link
Member

bcoe commented Dec 1, 2016

@nexdrew pointed out this edge-case:

when you enable both flatten-duplicate-arrays and duplicate-arguments-array are enabled

{
  "yargs": {
    "flatten-duplicate-arrays": false,
    "duplicate-arguments-array": false
  }
}

Running:

node test.js -x 1 2 3 -x 2 3 4

results in:

{ _: [],
  x: [ [ '1', '2', '3' ], [ '2', '3', '4' ] ],
  '$0': 'test.js' }

It seems like it would be more consistent with this new API for the result to be x: ['2', '3', '4']

CC: @laggingreflex if you're looking for your next contribution to yargs, would love help adding a test and fix for this.

@bcoe bcoe added the bug label Dec 1, 2016
laggingreflex added a commit to laggingreflex/yargs-parser that referenced this issue Dec 2, 2016
laggingreflex added a commit to laggingreflex/yargs-parser that referenced this issue Dec 2, 2016
@bcoe bcoe closed this as completed in #75 Jan 2, 2017
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