Automatically display default values of options in the help page#1032
Merged
FrankRay78 merged 6 commits intospectreconsole:mainfrom Dec 28, 2022
Merged
Automatically display default values of options in the help page#1032FrankRay78 merged 6 commits intospectreconsole:mainfrom
FrankRay78 merged 6 commits intospectreconsole:mainfrom
Conversation
81d944f to
61d7dd2
Compare
Contributor
|
Thank you for your contribution @0xced, just to let you know that I intend to review this PR over the coming weeks. |
Example before this commit:
```
DESCRIPTION:
Build and run a .NET project output.
USAGE:
fake-dotnet run [OPTIONS]
OPTIONS:
-h, --help Prints help information
-c, --configuration <CONFIGURATION> The configuration to run for. The default for most projects is 'Debug'
-f, --framework <FRAMEWORK> The target framework to run for. The target framework must also be specified in the project file
-r, --runtime <RUNTIMEIDENTIFIER> The target runtime to run for
-p, --project <PROJECTPATH> The path to the project file to run (defaults to the current directory if there is only one project)
--launch-profile <LAUNCHPROFILE> The name of the launch profile (if any) to use when launching the application
--no-launch-profile Do not attempt to use launchSettings.json to configure the application
--no-build Do not build the project before running. Implies --no-restore
--interactive Allows the command to stop and wait for user input or action (for example to complete authentication)
--no-restore Do not restore the project before building
--verbosity <VERBOSITY> Set the MSBuild verbosity level. Allowed values are quiet, minimal, normal, detailed, and diagnostic
--no-dependencies Do not restore project-to-project references and only restore the specified project
--force Force all dependencies to be resolved even if the last restore was successful. This is equivalent to deleting project.assets.json
```
Example after this commit:
```
DESCRIPTION:
Build and run a .NET project output.
USAGE:
fake-dotnet run [OPTIONS]
OPTIONS:
DEFAULT
-h, --help Prints help information
-c, --configuration <CONFIGURATION> Debug The configuration to run for. The default for most projects is 'Debug'
-f, --framework <FRAMEWORK> The target framework to run for. The target framework must also be specified in the project file
-r, --runtime <RUNTIMEIDENTIFIER> The target runtime to run for
-p, --project <PROJECTPATH> The path to the project file to run (defaults to the current directory if there is only one project)
--launch-profile <LAUNCHPROFILE> The name of the launch profile (if any) to use when launching the application
--no-launch-profile Do not attempt to use launchSettings.json to configure the application
--no-build Do not build the project before running. Implies --no-restore
--interactive Allows the command to stop and wait for user input or action (for example to complete authentication)
--no-restore Do not restore the project before building
--verbosity <VERBOSITY> Normal Set the MSBuild verbosity level. Allowed values are quiet, minimal, normal, detailed, and diagnostic
--no-dependencies Do not restore project-to-project references and only restore the specified project
--force Force all dependencies to be resolved even if the last restore was successful. This is equivalent to deleting project.assets.json
```
Fixes spectreconsole#973
By calling the new `config.DisableOptionsDefaultValues()` method.
61d7dd2 to
7177dd2
Compare
FrankRay78
suggested changes
Dec 23, 2022
src/Spectre.Console.Cli/Internal/Configuration/CommandAppSettings.cs
Outdated
Show resolved
Hide resolved
FrankRay78
approved these changes
Dec 28, 2022
Contributor
|
Thank you @0xced - a seriously good contribution you've made here. |
Contributor
Author
|
Oops, it looks like there's an issue with the NuGet API key:
|
Contributor
|
Thanks, I'll ping Patrik about this... |
Contributor
|
@FrankRay78 @0xced I'm on it |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #973