Skip to content

Commit

Permalink
Switch to the bulit-in provided -v|--version option
Browse files Browse the repository at this point in the history
We still decide how to run it thouh.
  • Loading branch information
kzu committed Jul 18, 2024
1 parent 7c78d80 commit c53b655
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
3 changes: 3 additions & 0 deletions src/dotnet-trx/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
app.Configure(config =>
{
config.SetApplicationName(ThisAssembly.Project.ToolCommandName);
// Causes -v|--version to be added to help
config.SetApplicationVersion(ThisAssembly.Project.Version);

if (Environment.GetEnvironmentVariables().Contains("NO_COLOR") &&
config.Settings.HelpProviderStyles?.Options is { } options)
options.DefaultValue = Style.Plain;
Expand Down
4 changes: 0 additions & 4 deletions src/dotnet-trx/TrxCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ public class TrxSettings : CommandSettings
[DefaultValue(false)]
public bool NoExitCode { get; init; } = false;

[Description("Show version information")]
[CommandOption("--version")]
public bool? Version { get; init; }

/// <summary>
/// Report as GitHub PR comment.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion src/dotnet-trx/help.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ USAGE:
OPTIONS:
DEFAULT
-h, --help Prints help information
-v, --version Prints version information
-p, --path Optional base directory for *.trx files
discovery. Defaults to current directory
-o, --output Include test output
-r, --recursive True Recursively search for *.trx files
--skipped True Include skipped tests
--no-exit-code Do not return a -1 exit code on test
failures
--version Show version information
--gh-comment True Report as GitHub PR comment
--gh-summary True Report as GitHub step summary
```

0 comments on commit c53b655

Please sign in to comment.