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: only run coercion functions once, despite aliases. (#76) #103

Merged
merged 1 commit into from
Dec 18, 2017

Conversation

Mike111177
Copy link
Contributor

@Mike111177 Mike111177 commented Sep 6, 2017

Fixes #76
Fixes yargs/yargs#923

@Mike111177 Mike111177 force-pushed the fix-repeated-coerce branch 3 times, most recently from 69dfb5b to e778e36 Compare September 6, 2017 23:02
@bcoe
Copy link
Member

bcoe commented Oct 4, 2017

@Mike111177 wouldn't this mean that if foo and bar are aliases, only one of either foo or bar has the appropriate final value? or am I missing something.

@Mike111177
Copy link
Contributor Author

@bcoe, no, note lines 523 and 524. Once a coerce function runs, it applies the value to all needed aliases. Then on the next rounds it ignores the aliases that have already been assigned to.

@bcoe bcoe merged commit 507aaef into yargs:master Dec 18, 2017
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.

None yet

2 participants