-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix confusing environment option help text in dotnet run command #50795
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
- Created CreateEnvOption factory method in CommonOptions - Added separate CmdTestEnvironmentVariableDescription resource string - Updated test command to use test-specific environment description - Run command now uses generic environment description without test text Co-authored-by: baronfel <[email protected]>
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.
This change is simple and appears correct in terms of making the test and other-command strings for the --env description different.
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 fixes the confusing help string for the -e|--environment
option in dotnet run --help
that incorrectly showed test-specific text about forcing tests to run in an isolated process.
Key changes:
- Split the shared environment option description into generic and test-specific versions
- Modified the factory pattern to accept custom descriptions for environment options
- Updated test command to use test-specific description while other commands use generic description
Reviewed Changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 13 comments.
File | Description |
---|---|
src/Cli/dotnet/CommonOptions.cs | Created factory method CreateEnvOption to accept custom descriptions for environment options |
src/Cli/dotnet/Commands/Test/TestCommandParser.cs | Updated to use test-specific environment description via new factory method |
src/Cli/dotnet/CliStrings.resx | Added new CmdTestEnvironmentVariableDescription resource and removed test-specific text from generic description |
src/Cli/dotnet/xlf/*.xlf | Updated localization files to reflect the resource string changes |
@copilot the pwsh and zsh test cases of VerifyCompletions are broken still, they probably need to be updated with the new description. In addition, the Microsoft.DotNet.Cli.Test.Tests.GivenDotnetTestContainsEnvironmentVariables.ItPassesEnvironmentVariablesFromCommandLineParametersWhenRunningViaCsproj test is failing. |
- Fixed option identity issue by creating separate TestEnvOption static field - Updated completion test snapshots for pwsh and zsh - Test command now uses test-specific environment description - Run command uses generic environment description without test text - All tests now pass including environment variable functionality Co-authored-by: baronfel <[email protected]>
Fixed both issues you mentioned:
All tests now pass including the environment variable functionality. Commit: 4ff185d |
/backport to release/10.0.1xx |
Started backporting to release/10.0.1xx: https://github.com/dotnet/sdk/actions/runs/17812861821 |
dotnet run
anddotnet test
commands use same sharedCommonOptions.EnvOption
with test-specific textFrameworkOption
CreateEnvOption(string description)
factory method inCommonOptions
CmdTestEnvironmentVariableDescription
resource string for test-specific textCmdEnvironmentVariableDescription
to contain generic text without test referencesTestCommandParser
to use test-specific descriptionTestEnvOption
static fieldFixed issues:
dotnet run --help
now shows generic environment variable help without test-specific textdotnet test --help
still shows "This will force the tests to be run in an isolated process."The changes are minimal and surgical, maintaining backward compatibility while fixing the confusing help text issue reported in #50794.
@baronfel's note: I've reviewed this and am happy with the code.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.