Migrate System.CommandLine from 2.0.0-beta4 to 2.0.5#7484
Merged
baywet merged 12 commits intodependabot/nuget/src/kiota/System.CommandLine-2.0.5from Mar 17, 2026
Merged
Migrate System.CommandLine from 2.0.0-beta4 to 2.0.5#7484baywet merged 12 commits intodependabot/nuget/src/kiota/System.CommandLine-2.0.5from
baywet merged 12 commits intodependabot/nuget/src/kiota/System.CommandLine-2.0.5from
Conversation
--- updated-dependencies: - dependency-name: System.CommandLine dependency-version: 2.0.5 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: baywet <7905502+baywet@users.noreply.github.com>
5792eb5 to
a9d2753
Compare
- Remove System.CommandLine.Hosting and System.CommandLine.Rendering package references - Update Program.cs to use new host/invocation pattern without CommandLineBuilder - Change BaseKiotaCommandHandler to extend AsynchronousCommandLineAction - Change all handlers to override InvokeAsync(ParseResult, CancellationToken) - Replace GetValueForOption/GetValueForArgument with GetValue - Replace FindResultFor with GetResult - Replace AddAlias with Aliases.Add, AddValidator with Validators.Add - Replace AddCompletions with CompletionSources.Add - Replace SetDefaultValue with DefaultValueFactory - Replace IsRequired with Required, ArgumentHelpName with HelpName - Replace Handler with Action on all commands - Fix Option constructors to use object initializer syntax with Description - Replace TableView usage with DisplayTable helper method - Pass IServiceProvider through command factory methods for handler injection - Replace ErrorMessage = with AddError() on OptionResult/CommandResult Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: baywet <7905502+baywet@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update System.CommandLine to version 2.0.5
Migrate System.CommandLine from 2.0.0-beta4 to 2.0.5
Mar 16, 2026
Member
|
@copilot run |
Co-authored-by: baywet <7905502+baywet@users.noreply.github.com>
Contributor
Author
baywet
requested changes
Mar 16, 2026
Co-authored-by: baywet <7905502+baywet@users.noreply.github.com>
baywet
requested changes
Mar 16, 2026
…ods and run dotnet format Co-authored-by: baywet <7905502+baywet@users.noreply.github.com>
Contributor
Author
baywet
requested changes
Mar 16, 2026
…der non-nullable in handlers Co-authored-by: baywet <7905502+baywet@users.noreply.github.com>
baywet
requested changes
Mar 17, 2026
Co-authored-by: baywet <7905502+baywet@users.noreply.github.com>
Contributor
Author
baywet
approved these changes
Mar 17, 2026
a6e54f7
into
dependabot/nuget/src/kiota/System.CommandLine-2.0.5
286 of 291 checks passed
github-actions bot
pushed a commit
that referenced
this pull request
Mar 17, 2026
* Bump System.CommandLine from 2.0.0-beta4.22272.1 to 2.0.5 --- updated-dependencies: - dependency-name: System.CommandLine dependency-version: 2.0.5 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * Migrate System.CommandLine from 2.0.0-beta4 to 2.0.5 (#7484) * Bump System.CommandLine from 2.0.0-beta4.22272.1 to 2.0.5 --- updated-dependencies: - dependency-name: System.CommandLine dependency-version: 2.0.5 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * Initial plan * Initial plan for System.CommandLine 2.0.5 migration Co-authored-by: baywet <7905502+baywet@users.noreply.github.com> * Migrate System.CommandLine from 2.0.0-beta4 to 2.0.5 - Remove System.CommandLine.Hosting and System.CommandLine.Rendering package references - Update Program.cs to use new host/invocation pattern without CommandLineBuilder - Change BaseKiotaCommandHandler to extend AsynchronousCommandLineAction - Change all handlers to override InvokeAsync(ParseResult, CancellationToken) - Replace GetValueForOption/GetValueForArgument with GetValue - Replace FindResultFor with GetResult - Replace AddAlias with Aliases.Add, AddValidator with Validators.Add - Replace AddCompletions with CompletionSources.Add - Replace SetDefaultValue with DefaultValueFactory - Replace IsRequired with Required, ArgumentHelpName with HelpName - Replace Handler with Action on all commands - Fix Option constructors to use object initializer syntax with Description - Replace TableView usage with DisplayTable helper method - Pass IServiceProvider through command factory methods for handler injection - Replace ErrorMessage = with AddError() on OptionResult/CommandResult Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Migrate System.CommandLine from beta4 to 2.0.5 API Co-authored-by: baywet <7905502+baywet@users.noreply.github.com> * Apply dotnet format Co-authored-by: baywet <7905502+baywet@users.noreply.github.com> * Make serviceProvider parameter required in all GetXXXCommand methods Co-authored-by: baywet <7905502+baywet@users.noreply.github.com> * Make serviceProvider parameter non-nullable in all GetXXXCommand methods and run dotnet format Co-authored-by: baywet <7905502+baywet@users.noreply.github.com> * Pass CancellationToken to InvokeAsync/StopAsync and make ServiceProvider non-nullable in handlers Co-authored-by: baywet <7905502+baywet@users.noreply.github.com> * Fix ProcessExit disposal guard and use Spectre.Console for tables Co-authored-by: baywet <7905502+baywet@users.noreply.github.com> * chore: no borders for tables --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: baywet <7905502+baywet@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Vincent Biret <vibiret@microsoft.com> * chore: reverts global.json changes --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Vincent Biret <vibiret@microsoft.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: baywet <7905502+baywet@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Adrian <christiano+github@microsoft.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
System.CommandLine.HostingandSystem.CommandLine.Renderingpackage referencesProgram.csto use new API, including aCancellationTokenSourcetriggered byConsole.CancelKeyPressandAppDomain.CurrentDomain.ProcessExit; pass the token tohost.StartAsync,InvokeAsync, andhost.StopAsync; guardProcessExitcallback againstObjectDisposedExceptionon normal exitBaseKiotaCommandHandler.cs: extendAsynchronousCommandLineAction, new signature; makeServiceProviderpropertyrequiredand non-nullable (IServiceProvider)KiotaHost.cs,KiotaClientCommands.cs,KiotaPluginCommands.cs,KiotaWorkspaceCommands.cs; makeserviceProviderparameter required and non-nullable in allGetXXXCommandmethodsServiceProvider?.GetService<>()toServiceProvider.GetService<>()ServiceProviderpropertyrequiredand non-nullable inKiotaRpcCommandHandlerSpectre.Consolepackage and replace hand-craftedDisplayTable()(pipes/dashes) withAnsiConsole.Write(table)using Spectre.ConsoleTableKiotaHostTests.cstests to use new API withServiceCollection().BuildServiceProvider()dotnet formatand commit changes✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.