From 484b0b57908c6b51d009bab6332a2843fee4427f Mon Sep 17 00:00:00 2001 From: Daniel Cazzulino Date: Mon, 20 Feb 2023 00:17:41 -0300 Subject: [PATCH] Change nugetize default to non-verbose We were showing MSBuild output for any nugetize run that took longer than 10 seconds. Diagnosing slow builds shouldn't be a nugetizer issue, and it makes it confusing to see potentially many warnings and what-not that are irrelevant to packing. Make it so instead of asking for quiet, you can ask for verbose and get the output. If there were errors running the tool, we'd still want to see the MSBuild output, though. --- src/dotnet-nugetize/Program.cs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/dotnet-nugetize/Program.cs b/src/dotnet-nugetize/Program.cs index 5f5b030f..51837847 100644 --- a/src/dotnet-nugetize/Program.cs +++ b/src/dotnet-nugetize/Program.cs @@ -26,7 +26,7 @@ class Program bool binlog = Debugger.IsAttached; bool debug = Debugger.IsAttached && Environment.GetEnvironmentVariable("DEBUG_NUGETIZER") != "0"; - bool quiet = false; + bool verbose = false; string items; List extra; @@ -85,7 +85,7 @@ int Run(string[] args) { "?|h|help", "Display this help.", h => help = h != null }, { "b|bl|binlog", "Generate binlog.", b => binlog = b != null }, { "d|debug", "Debug nugetizer tasks.", d => debug = d != null, true }, - { "q|quiet", "Don't render MSBuild output.", q => quiet = q != null }, + { "v|verbose", "Render MSBuild output.", v => verbose = v != null }, { "i|items:", "MSBuild items file path containing full package contents metadata.", i => items = Path.GetFullPath(i) }, { "version", "Render tool version and copyright information.", v => version = v != null }, } @@ -455,11 +455,10 @@ bool Execute(string program, string arguments) //=> AnsiConsole.Status().Start(" if (!timedout) output.Append(proc.StandardOutput.ReadToEnd()); - if (quiet) - return proc.ExitCode == 0; + if (!verbose && proc.ExitCode == 0) + return true; - if (timedout || proc.ExitCode != 0) - Console.Out.Write(output.ToString()); + Console.Out.Write(output.ToString()); return proc.ExitCode == 0; }