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: calling parse multiple times now appropriately maintains state (#1137) #1369

Merged
merged 2 commits into from Jul 29, 2019
Merged

fix: calling parse multiple times now appropriately maintains state (#1137) #1369

merged 2 commits into from Jul 29, 2019

Conversation

mleguen
Copy link
Member

@mleguen mleguen commented Jun 26, 2019

Extends the freezing/unfreezing mechanism already in place for parse(args, cb) to parse() (without arguments) to be able to call it several times with the same behavior.

Also corrects the builder function return value handler for it no longer to depend on yargs.parsed being set after a call to parse() (which is no longer the case after unfreezing).

Closes #1137

calling parse several times with commands gives different results
Allows calling parse without arguments multiple times, when commands
are defined.
@bcoe
Copy link
Member

bcoe commented Jun 27, 2019

@mleguen I'll definitely have to look at this work closely, years since I touched these bits 😄

but this sounds like awesome progress.

@bcoe bcoe changed the title (fix) allow calling parse without arguments multiple times (#1137) fix: calling parse multiple times now appropriately maintains state (#1137) Jul 13, 2019
test/yargs.js Show resolved Hide resolved
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.

when in singleton mode, calling parse() multiple times results in undefined behavior
2 participants