Skip to content

Parser configuration strip-aliased does not work with coerce #2159

@xmedeko

Description

@xmedeko

Even when parser configuration strip-aliased is true, then it does not work if an option has coerce, e.g. see:

const args = require("yargs")
    .parserConfiguration({ "strip-aliased": true })
    .option("log", { alias: ["l", "ll"], coerce: s => s })
    .parse("-l 1");
delete args["$0"]; delete args["_"];
// args is { log: 1, l: 1, ll: 1 } 

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions