Skip to content

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

@ehmicky

Description

@ehmicky

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.

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