Skip to content

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

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.

Activity

  1. transferred this issue fromyargs/yargson Mar 26, 2021
  2. shadowspawn commented on Mar 12, 2023

    @shadowspawn
    Member

    Possibly related: #193

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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