-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Change help structure in dotnet test #47288
Change help structure in dotnet test #47288
Conversation
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.
PR Overview
This PR refactors the help structure in the dotnet test command by splitting the help output into platform and extension options and updating the related reporting in the terminal.
- Split the original custom help into two methods: one for the overall help options and one dedicated to platform and extension options.
- Removed the old WriteCustomHelp method and its related helpers, integrating similar functionality into the new structure.
- Updated the TerminalTestReporter to use a new WriteOtherOptionsSection method that aligns with the new help layout.
Reviewed Changes
File | Description |
---|---|
src/Cli/dotnet/commands/dotnet-test/TestingPlatformCommand.Help.cs | Refactored help commands to separate built-in (platform) and extension options, integrating missing options display. |
src/Cli/dotnet/commands/dotnet-test/Terminal/TerminalTestReporter.cs | Updated header and added a new WriteOtherOptionsSection method for displaying options help in the terminal. |
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (2)
src/Cli/dotnet/commands/dotnet-test/TestingPlatformCommand.Help.cs:97
- The call to builtInOptions.Any() assumes builtInOptions is not null. Consider adding a null-check or defaulting to an empty list to avoid potential NullReferenceExceptions.
if (builtInOptions.Any())
src/Cli/dotnet/commands/dotnet-test/TestingPlatformCommand.Help.cs:103
- The call to nonBuiltInOptions.Any() assumes nonBuiltInOptions is not null. Ensure a null-check or use a default empty list to prevent possible runtime errors.
if (nonBuiltInOptions.Any())
src/Cli/dotnet/commands/dotnet-test/Terminal/TerminalTestReporter.cs
Outdated
Show resolved
Hide resolved
…ter.cs Co-authored-by: kasperk81 <83082615+kasperk81@users.noreply.github.com>
…st' of https://github.com/dotnet/sdk into dev/mabdullah/change-help-option-structure-in-dotnet-test
…st' of https://github.com/dotnet/sdk into dev/mabdullah/change-help-option-structure-in-dotnet-test
This pull request includes several updates to the
dotnet-test
command's help system to improve the organization and presentation of help options. The changes focus on refactoring methods for better clarity and functionality.Refactoring and improvements to help system:
src/Cli/dotnet/commands/dotnet-test/Terminal/TerminalTestReporter.cs
: AddedWriteOtherOptionsSection
method to display additional help options in a structured format.src/Cli/dotnet/commands/dotnet-test/TestingPlatformCommand.Help.cs
: ReplacedWriteCustomHelp
withWritePlatformAndExtensionOptions
to separate platform and extension options more clearly. [1] [2]src/Cli/dotnet/commands/dotnet-test/TestingPlatformCommand.Help.cs
: AddedWriteHelpOptions
method to streamline the help layout and improve readability.These changes enhance the user experience by providing a more organized and comprehensive help output.
Relates to #45927