Skip to content

Converting to use System.CommandLine - #14379

Merged
sfoslund merged 21 commits into
dotnet:masterfrom
sfoslund:SystemCommandLine
Nov 18, 2020
Merged

sfoslund merged 21 commits into
dotnet:masterfrom
sfoslund:SystemCommandLine

Conversation

@sfoslund

Copy link
Copy Markdown
Member

No description provided.

@sfoslund

Copy link
Copy Markdown
Member Author

@jonsequitur I'm seeing any tokens after "--" being ignored, is there a way to opt out of this behavior and include those tokens in the parse result?

@wli3 tagging you here in case you have any input or feedback on the changes so far.

@AntonLapounov

Copy link
Copy Markdown
Contributor

We have found that System.CommandLine has a noticeable performance overhead (in particular, due to its use of reflection), so we had to switch the command-line parser back in the runtime repo.

@wli3

wli3 commented Oct 30, 2020 •

Copy link
Copy Markdown

@AntonLapounov the new parser was a fork of existing SDK parser, so it won't be a significate regression compared with the old if no improvement. Also, CLI performance is not as sensitive as runtime. The correctness and the ability to handle complexity have higher priority.

@wli3

wli3 commented Oct 30, 2020

Copy link
Copy Markdown

@jonsequitur it uses reflection in the low abstraction API as in this case too? Or it is in invocation pipeline?

Comment thread src/Cli/dotnet/CommandBase.cs Resolved
Comment thread src/Cli/dotnet/CommandLineParser.cs Resolved
Comment thread src/Cli/dotnet/CommandLineParser.cs Resolved
Comment thread src/Cli/dotnet/CommandLineParser.cs Resolved
@sfoslund
sfoslund requested review from a team and donJoseLuis as code owners November 9, 2020 23:38
@sfoslund

sfoslund commented Nov 9, 2020

Copy link
Copy Markdown
Member Author

@wli3 most tests should be passing now (known failures are being tracked here: #14461), do you mind reviewing when you have time?

@kartheekp-ms

Copy link
Copy Markdown
Contributor

@sfoslund - On the NuGet Client side, we use Microsoft.Extensions.CommandLineUtils package for Command-line parsing API. For e.g. dotnet add package command on our side has this implementation. Please let us know if you are expecting any changes in the downstream due to this PR.

@sfoslund

Copy link
Copy Markdown
Member Author

@kartheekp-ms you shouldn't have any effects downstream from this change. We are switching to use a different parser but the way we call you and the parameters we pass will stay the same.

@wli3

wli3 commented Nov 11, 2020

Copy link
Copy Markdown

Give me some time, it will review this thoroughly too

@wli3 wli3 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not done yet :)

@wli3 wli3 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finished reviewing all production code. Now looking into tests...

Comment thread src/Cli/dotnet/Program.cs Resolved
Comment thread src/Cli/dotnet/Program.cs Resolved
Comment thread src/Cli/dotnet/Program.cs Resolved
Comment thread src/Cli/dotnet/Program.cs Resolved

@wli3 wli3 left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now I am done for an round of review

@wli3 wli3 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All issues I find should be resolved now. Other than the 2 new questions. If the answers are we are good. Let's merge it before it get more merge conflicts

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.

7 participants