diff --git a/src/dotnet-trx/Program.cs b/src/dotnet-trx/Program.cs index 26d452c..d4b8760 100644 --- a/src/dotnet-trx/Program.cs +++ b/src/dotnet-trx/Program.cs @@ -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; diff --git a/src/dotnet-trx/TrxCommand.cs b/src/dotnet-trx/TrxCommand.cs index 16eeb55..b309fa3 100644 --- a/src/dotnet-trx/TrxCommand.cs +++ b/src/dotnet-trx/TrxCommand.cs @@ -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; } - /// /// Report as GitHub PR comment. /// diff --git a/src/dotnet-trx/help.md b/src/dotnet-trx/help.md index 335bb3a..ca30020 100644 --- a/src/dotnet-trx/help.md +++ b/src/dotnet-trx/help.md @@ -5,6 +5,7 @@ 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 @@ -12,7 +13,6 @@ OPTIONS: --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 ```