Skip to content

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

Closed
@bcoe

Description

@bcoe

@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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions