Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
xmedeko opened this issue Apr 5, 2022 · 1 comment
Closed

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

xmedeko opened this issue Apr 5, 2022 · 1 comment
Assignees
Labels

Comments

@xmedeko
Copy link

xmedeko commented Apr 5, 2022

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 } 
@xmedeko
Copy link
Author

xmedeko commented Apr 20, 2022

@jly36963 Thanks, fixed in 17.4.1. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants