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

fix(coerce): options using coerce now displayed in help #1911

Merged
merged 2 commits into from Apr 11, 2021
Merged

Conversation

bcoe
Copy link
Member

@bcoe bcoe commented Apr 11, 2021

The trick we were using of .alias("foo", "foo") to "tell" yargs-parser about a key
using coerce has a bug such that help output is broken. We can instead use
.key (https://github.com/yargs/yargs-parser/blob/master/lib/yargs-parser.ts#L191) which
is designed for exactly our purposes (telling yargs-parser a key exists, without
setting attributes such as description).

Fixes #1909

The trick we were using of .alias("foo", "foo") to "tell" yargs-parser about a key
using coerce has a bug such that help output is broken. We can instead use
.key (https://github.com/yargs/yargs-parser/blob/master/lib/yargs-parser.ts#L191) which
is designed for exactly our purposes (telling yargs-parser a key exists, without
setting attributes such as description).

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

Successfully merging this pull request may close these issues.

yargs 17: option not listed in help output when coerced
1 participant