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: help always displayed for the first command parsed having an async handler #1535

Merged
merged 2 commits into from Feb 5, 2020

Conversation

mleguen
Copy link
Member

@mleguen mleguen commented Jan 29, 2020

Close #1533

After a call to .parse() for a command with an async handler, next calls to parse, if they need to display help, display help for this command.

@mleguen mleguen force-pushed the 1533-fix-context-commands-not-being-freezed branch from 3773ee2 to 0f4e8ca Compare January 29, 2020 15:30
@bcoe bcoe changed the title Fix: help always displayed for the first command parsed having an async handler fix: help always displayed for the first command parsed having an async handler Jan 29, 2020
@bcoe
Copy link
Member

bcoe commented Jan 29, 2020

@mleguen caching in general can lead to some gnarly bugs (I've heard it called "one of the hard problems in computer science").

Another option, do we stop caching, how much do we care about the performance gain? Or did we add caching to address another bug?

@mleguen mleguen marked this pull request as ready for review January 29, 2020 16:52
@mleguen
Copy link
Member Author

mleguen commented Jan 29, 2020

This is not a performance cache, only something to still be able to display help for the command whose async handler is "running in the background" when yargs returned and can already have been modified.

IMHO, this is a bad idea anyway, so I would be happy to drop it.

@bcoe
Copy link
Member

bcoe commented Jan 30, 2020

@mleguen would we regress a bug that the cache was added to address? I would prefer simplifying if we think this is a feature that people don't need too often ... it might be worth keeping if we specifically added this to address problems.

@mleguen
Copy link
Member Author

mleguen commented Jan 31, 2020

@bcoe Here is what I suggest:

@mleguen mleguen force-pushed the 1533-fix-context-commands-not-being-freezed branch from e36667e to 1af8449 Compare February 5, 2020 11:12
@mleguen mleguen requested a review from bcoe February 5, 2020 12:37
@bcoe bcoe merged commit 6481d61 into master Feb 5, 2020
@bcoe bcoe deleted the 1533-fix-context-commands-not-being-freezed branch February 5, 2020 22:03
bcoe pushed a commit that referenced this pull request Feb 5, 2020
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.

Bug: .parse not resetting context
2 participants