Skip to content

Dot-notation boolean flags aren't parsed correctly #617

Closed
yargs/yargs-parser
#63
@lasalvavida

Description

@lasalvavida

Given the following example:

testScript.js

var argv = require('yargs')
    .options({
        'nested.value': {
            type: 'boolean'
        }
    }).argv;

console.log(argv);

./bin/testScript

{ _: [],
nested: { value: false },
'$0': 'bin\testScript.js' }

./bin/testScript.js --nested.value

{ _: [],
nested: { value: [ false, true ] },
'$0': 'bin\testScript.js' }

The value is placed into an array instead of changing the boolean value.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions