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

don't mutate command on subsequent calls to Invoke extension #781

Conversation

@jonsequitur
Copy link
Contributor

jonsequitur commented Feb 13, 2020

This fixes a bug where calling the Command.Invoke / Command.InvokeAsync extension methods more than once on the same Command instance would throw due to global options being added twice to the implictly-created parser. Now, that parser is cached and reused.

@jonsequitur jonsequitur requested a review from Keboo Feb 13, 2020
@Keboo
Keboo approved these changes Feb 13, 2020
src/System.CommandLine/CommandExtensions.cs Outdated Show resolved Hide resolved
jonsequitur and others added 4 commits Feb 13, 2020
Co-Authored-By: Kevin B <Keboo@users.noreply.github.com>
https://github.com/jonsequitur/command-line-api into dont-mutate-command-more-than-once-on-implicit-invoke
@jonsequitur jonsequitur merged commit 20d7700 into dotnet:master Feb 13, 2020
9 checks passed
9 checks passed
WIP Ready for review
Details
command-line-api Build #20200213.5 succeeded
Details
command-line-api (Build and Test OSX Debug) Build and Test OSX Debug succeeded
Details
command-line-api (Build and Test OSX Release) Build and Test OSX Release succeeded
Details
command-line-api (Build and Test Ubuntu 16.04 Debug) Build and Test Ubuntu 16.04 Debug succeeded
Details
command-line-api (Build and Test Ubuntu 16.04 Release) Build and Test Ubuntu 16.04 Release succeeded
Details
command-line-api (Build and Test Windows Debug) Build and Test Windows Debug succeeded
Details
command-line-api (Build and Test Windows Release) Build and Test Windows Release succeeded
Details
license/cla All CLA requirements met.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.