Skip to content

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

Merged
bcoe merged 2 commits intomasterfrom
fix-1909-2
Apr 11, 2021
Merged

fix(coerce): options using coerce now displayed in help#1911
bcoe merged 2 commits intomasterfrom
fix-1909-2

Conversation

@bcoe
Copy link
Copy Markdown
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

bcoe added 2 commits April 10, 2021 20:54
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