-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add dotnetup --info, dotnetup --version, dotnetup list
#52717
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
base: release/dnup
Are you sure you want to change the base?
Conversation
adds architecture, sha, and version for debugging customer issues more easily
… than sdk install now
dotnetup --info, dotnetup --version, dotnetup list` dotnetup --info, dotnetup --version, dotnetup list
This reverts commit 8ff8bf4.
Separate console IO out because disposing concurrent spectre console writers causes failures
may not actually be the right thing to do here, checking..
There was a problem hiding this 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 --infooption to display dotnetup version, architecture, commit, and optionally list managed installations - Adds
dotnetup listsubcommand to list all .NET SDKs and runtimes managed by dotnetup - Adds
Parser.Versionproperty and tests for--versionfunctionality (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 |
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]>
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.

Resolves #50613
Please see the added documentation specs for options provided.
A machine readable format via
--jsonis added alongside a human readable version.