From fb71e1a815303f4ba9cc7483c300c7548fa48575 Mon Sep 17 00:00:00 2001 From: Daniel Cazzulino Date: Mon, 2 Sep 2024 13:57:05 -0300 Subject: [PATCH] Improve style disable when NO_COLOR Also improve IDE speed by not regenerating help.md in design-time builds. See also https://github.com/spectreconsole/spectre.console/issues/1583#issuecomment-2276612495 --- src/dotnet-trx/Program.cs | 5 ++--- src/dotnet-trx/dotnet-trx.csproj | 11 ++++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/dotnet-trx/Program.cs b/src/dotnet-trx/Program.cs index d4b8760..3a0a2c8 100644 --- a/src/dotnet-trx/Program.cs +++ b/src/dotnet-trx/Program.cs @@ -26,9 +26,8 @@ // 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; + if (Environment.GetEnvironmentVariables().Contains("NO_COLOR")) + config.Settings.HelpProviderStyles = null; }); if (args.Contains("--version")) diff --git a/src/dotnet-trx/dotnet-trx.csproj b/src/dotnet-trx/dotnet-trx.csproj index 87f344b..232ee41 100644 --- a/src/dotnet-trx/dotnet-trx.csproj +++ b/src/dotnet-trx/dotnet-trx.csproj @@ -35,10 +35,11 @@ - - - - - + + + + + \ No newline at end of file