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: dont clobber description for multiple option calls #2171

Merged
merged 5 commits into from Jul 18, 2022

Conversation

lukekarrys
Copy link
Contributor

Fixes #2169

My original patch from #2169 broke some existing tests, due to it being necessary to call this.describe when initially setting up an option even if no explicit description is set.

So this PR implements this behavior by only calling this.describe if there is no existing description OR if the new description is a string.

I added a test that I confirmed fails on main and passes in this PR.

test/usage.cjs Outdated Show resolved Hide resolved
lib/yargs-factory.ts Outdated Show resolved Hide resolved
@jly36963
Copy link
Contributor

jly36963 commented May 6, 2022

Left one nit; otherwise, it looks great to me 👍

@jly36963 jly36963 self-assigned this May 6, 2022
@bcoe
Copy link
Member

bcoe commented May 16, 2022

@lukekarrys looks good to me, mind addressing @jly36963's one nit, and we'll work on merging?

@lukekarrys
Copy link
Contributor Author

@jly36963 @bcoe I pushed a fixup commit addressing the feedback, and I believe this should be good now

@jly36963
Copy link
Contributor

Looks good to me 👍

@bcoe bcoe merged commit f91d9b3 into yargs:main Jul 18, 2022
@bcoe
Copy link
Member

bcoe commented Jul 18, 2022

@lukekarrys thank you for the contribution, apologies for the terribly slow review.

@lukekarrys lukekarrys deleted the lk/2169-clobber-descr branch July 19, 2022 19:57
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.

subsequent calls to options remove existing description
3 participants