Skip to content

Automatically display default values of options in the help page#1032

Merged
FrankRay78 merged 6 commits intospectreconsole:mainfrom
0xced:help-options-default-value
Dec 28, 2022
Merged

Automatically display default values of options in the help page#1032
FrankRay78 merged 6 commits intospectreconsole:mainfrom
0xced:help-options-default-value

Conversation

@0xced
Copy link
Contributor

@0xced 0xced commented Oct 28, 2022

Fixes #973

@0xced 0xced force-pushed the help-options-default-value branch 2 times, most recently from 81d944f to 61d7dd2 Compare November 25, 2022 08:31
@FrankRay78
Copy link
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.
@0xced 0xced force-pushed the help-options-default-value branch from 61d7dd2 to 7177dd2 Compare December 17, 2022 15:02
@FrankRay78 FrankRay78 merged commit 3e6e099 into spectreconsole:main Dec 28, 2022
@FrankRay78
Copy link
Contributor

Thank you @0xced - a seriously good contribution you've made here.

@0xced 0xced deleted the help-options-default-value branch December 28, 2022 21:28
@0xced
Copy link
Contributor Author

0xced commented Dec 28, 2022

Oops, it looks like there's an issue with the NuGet API key:

Response status code does not indicate success: 403 (The specified API key is invalid, has expired, or does not have permission to access the specified package.)

@FrankRay78
Copy link
Contributor

Thanks, I'll ping Patrik about this...

@patriksvensson
Copy link
Contributor

@FrankRay78 @0xced I'm on it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Proposal: automatically display default values of options in the help page

3 participants

Comments