-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Fix help option formatting to use comma-space separator instead of pipe #63284
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
Conversation
Co-authored-by: danmoseley <[email protected]>
Looks like this now, which seems reasonable
|
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 PR improves the formatting of command-line option help text in the shared CommandLineUtils library by replacing pipe separators (|
) with comma-space separators (,
) to match modern CLI conventions and enhance readability.
- Adds a
GetDisplayText()
method toCommandOption
that formats option names with comma-space separators - Updates help text generation in
CommandLineApplication
to use the new formatted display text - Maintains full compatibility with all option types (symbol, short, long options, and value parameters)
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
File | Description |
---|---|
src/Shared/CommandLineUtils/CommandLine/CommandOption.cs | Adds GetDisplayText() method to format option names with comma-space separators |
src/Shared/CommandLineUtils/CommandLine/CommandLineApplication.cs | Updates help text generation to use formatted display text instead of raw template |
@copilot there is a test failure, below. Please fix the test, and ensure you run it and it passes.
|
Co-authored-by: danmoseley <[email protected]>
Head branch was pushed to by a user without write access
... Fixed the test in commit 014f221. The |
@radical look OK? |
Co-authored-by: radical <[email protected]>
Added an explicit test. Looks good to me. |
The help output for
dotnet dev-certs
,dotnet user-secrets
, anddotnet user-jwts
was displaying option flags with confusing formatting that made the--
prefix appear connected to the|
separator:Before:
After:
This change updates the shared
CommandLineUtils
library to format option display text using comma-space separation (likedotnet new
and other modern CLI tools) instead of pipe separation. The fix:GetDisplayText()
method toCommandOption
that properly formats option names with comma-space separatorsCommandLineApplication.GetHelpText()
to use the formatted display text instead of the raw template-?
), short options (-h
), long options (--help
), and value parameters (<PROJECT>
)The improved formatting enhances readability and follows modern CLI conventions. This change affects all tools that use the shared CommandLineUtils library, including
dotnet-openapi
anddotnet-getdocument
as a bonus improvement.All existing functionality is preserved, and all tests continue to pass.
Fixes #62716.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.