Skip to content

Conversation

@nagilson
Copy link
Member

Resolves #50613

Please see the added documentation specs for options provided.
A machine readable format via --json is added alongside a human readable version.

adds architecture, sha, and version for debugging customer issues more easily
@nagilson nagilson changed the title Add dotnetup --info, dotnetup --version, dotnetup list` Add dotnetup --info, dotnetup --version, dotnetup list Jan 28, 2026
@nagilson
Copy link
Member Author

nagilson commented Jan 29, 2026

Hm, I'm wondering why we're running SDK tests on the dnup branch.
image
Anyway, this is part of why I didn't intend to do so 😁

Edit: Ah, I changed copilot instructions which are in the sdk code root.

@nagilson nagilson marked this pull request as ready for review January 29, 2026 17:54
Copilot AI review requested due to automatic review settings January 29, 2026 17:54
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 pull request adds diagnostic and introspection capabilities to the dotnetup tool by implementing --info, --version, and list commands. These features enable users to view information about the dotnetup tool itself and list .NET installations it manages, addressing issue #50613.

Changes:

  • Adds dotnetup --info option to display dotnetup version, architecture, commit, and optionally list managed installations
  • Adds dotnetup list subcommand to list all .NET SDKs and runtimes managed by dotnetup
  • Adds Parser.Version property and tests for --version functionality (implementation missing)
  • Provides both human-readable and machine-readable (JSON) output formats for all new commands
  • Updates localization files with new strings marked as "new" for translation
  • Adds comprehensive test coverage and documentation

Reviewed changes

Copilot reviewed 31 out of 31 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
src/Installer/dotnetup/Parser.cs Adds InfoOption, Version property, list command registration, and root action handler for --info
src/Installer/dotnetup/Program.cs Simplifies invocation by directly calling Parser.Invoke(args)
src/Installer/dotnetup/CommonOptions.cs Adds shared JsonOption for use across commands
src/Installer/dotnetup/Commands/Info/InfoCommand.cs Implements --info command with human-readable and JSON output
src/Installer/dotnetup/Commands/Info/InfoCommandParser.cs Defines options for --info command
src/Installer/dotnetup/Commands/List/ListCommand.cs Implements list command with InstallationLister utility class
src/Installer/dotnetup/Commands/List/ListCommandParser.cs Defines list subcommand and its options
src/Installer/Microsoft.Dotnet.Installation/InstallComponent.cs Adds GetDisplayName extension method for component display names
src/Installer/dotnetup/Commands/Sdk/Install/SdkInstallCommandParser.cs Updates description from "Installs the .NET SDK" to "Installs .NET"
src/Installer/dotnetup/Strings.resx Adds new localized strings for info and list commands
src/Installer/dotnetup/xlf/*.xlf Updates all localization files with new strings marked as "new"
src/Installer/dotnetup/dotnetup.csproj Adds versioning configuration (VersionPrefix and PreReleaseVersionLabel)
test/dotnetup.Tests/ParserTests.cs Adds tests for --version option parsing and output
test/dotnetup.Tests/InfoCommandTests.cs Comprehensive tests for info command functionality
test/dotnetup.Tests/ListCommandTests.cs Comprehensive tests for list command functionality
documentation/general/dotnetup/dotnetup-info.md Complete documentation for --info command
documentation/general/dotnetup/dotnetup-list.md Complete documentation for list command
src/Installer/installer.code-workspace Updates debug launch configuration for more flexible argument input
.github/copilot-instructions.md Adds dotnetup-specific build and test instructions

nagilson and others added 10 commits January 29, 2026 11:05
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
This allows --info to have options like --json where it cant do that if its a bool. A bit hacky and it doesn't display on the root command but I think that's acceptable.
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.

2 participants