Skip to content

dotnet root command and dotnet watch#52583

Merged
tmat merged 6 commits intodotnet:release/10.0.3xxfrom
tmat:WatchCommand
Jan 28, 2026
Merged

dotnet root command and dotnet watch#52583
tmat merged 6 commits intodotnet:release/10.0.3xxfrom
tmat:WatchCommand

Conversation

@tmat
Copy link
Member

@tmat tmat commented Jan 20, 2026

Add DotnetCommandDefinition.

Refactor nuget and completions commands to follow the established command definition pattern.

Remove dependency on dotnet from dotnet-watch. Decreases the number of files in dotnet-watch redist dir from 390 down to 206 and size from 43MB to 26MB.

@tmat
Copy link
Member Author

tmat commented Jan 23, 2026

@MiYanni ptal

@tmat tmat closed this Jan 23, 2026
@tmat tmat reopened this Jan 23, 2026
@tmat
Copy link
Member Author

tmat commented Jan 23, 2026

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copilot AI review requested due to automatic review settings January 24, 2026 02:17
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the .NET CLI's command-line parsing infrastructure to improve consistency and reduce dependencies. It introduces a new DotNetCommandDefinition class that serves as the root command definition, migrates all subcommand parsers from a GetCommand() pattern to a ConfigureCommand() pattern, creates new command definitions for nuget and completions commands, and removes the dotnet-watch tool's dependency on the main dotnet project. This significantly reduces the size of dotnet-watch from 390 files (43MB) to 206 files (26MB).

Changes:

  • Introduced DotNetCommandDefinition as a centralized root command definition containing all subcommands
  • Refactored all command parsers from a static GetCommand() pattern to instance-based ConfigureCommand() methods
  • Created new command definition classes for nuget and completions commands with proper structure

Reviewed changes

Copilot reviewed 92 out of 92 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/Cli/Microsoft.DotNet.Cli.Definitions/Commands/DotNetCommandDefinition.cs New root command definition containing all dotnet subcommands
src/Cli/Microsoft.DotNet.Cli.Definitions/Commands/NuGet/NuGetCommandDefinition.cs New structured definition for nuget command and all subcommands
src/System.CommandLine.StaticCompletions/CompletionsCommandDefinition.cs New completions command definition
src/System.CommandLine.StaticCompletions/CompletionsCommandParser.cs Parser for completions with shell provider dictionary
src/System.CommandLine.StaticCompletions/ShellName.cs Constants for shell names (bash, pwsh, fish, zsh, nushell)
src/Cli/dotnet/Parser.cs Refactored to use new command definition pattern
src/Cli/dotnet/Commands/*CommandParser.cs All parsers changed from GetCommand() to ConfigureCommand()
src/System.CommandLine.StaticCompletions/shells/*ShellProvider.cs Updated to use ShellNames constants; PowershellShellProvider renamed to PowerShellShellProvider
src/BuiltInTools/dotnet-watch/dotnet-watch.csproj Removed dependency on dotnet project, added dependency on Cli.Definitions
src/BuiltInTools/dotnet-watch/CommandLine/CommandLineOptions.cs Updated to instantiate DotNetCommandDefinition directly
test/dotnet.Tests/CompletionTests/snapshots/* Updated completion snapshots reflecting option ordering changes
src/Cli/dotnet/xlf/*.xlf Removed SDKSchemaCommandDefinition translations (moved to Definitions)
src/Cli/Microsoft.DotNet.Cli.Definitions/xlf/*.xlf Added SDKSchemaCommandDefinition translations
src/Cli/dotnet/CliStrings.resx Removed SDKSchemaCommandDefinition resource
src/Cli/Microsoft.DotNet.Cli.Definitions/CommandDefinitionStrings.resx Added SDKSchemaCommandDefinition resource

@tmat
Copy link
Member Author

tmat commented Jan 26, 2026

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@tmat
Copy link
Member Author

tmat commented Jan 27, 2026

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@tmat
Copy link
Member Author

tmat commented Jan 27, 2026

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@tmat
Copy link
Member Author

tmat commented Jan 28, 2026

/ba-g SSL

@tmat tmat merged commit 0346e09 into dotnet:release/10.0.3xx Jan 28, 2026
25 of 27 checks passed
@tmat tmat deleted the WatchCommand branch January 28, 2026 16:34
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.

3 participants