From 245c30c296f682ea472d1c791b7be2804b33b7dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20=C5=9Alusarz?= Date: Fri, 3 Jul 2020 14:55:29 +0200 Subject: [PATCH] Add --quiet option. Being quiet should have been the default, but I guess it's too late now to change it. --- StandAlone/StandAlone.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/StandAlone/StandAlone.cpp b/StandAlone/StandAlone.cpp index 662b68d1..79f13afe 100644 --- a/StandAlone/StandAlone.cpp +++ b/StandAlone/StandAlone.cpp @@ -107,6 +107,7 @@ bool SpvToolsDisassembler = false; bool SpvToolsValidate = false; bool NaNClamp = false; bool stripDebugInfo = false; +bool beQuiet = false; // // Return codes from main/exit(). @@ -661,6 +662,8 @@ void ProcessArguments(std::vector>& workItem variableName = argv[1]; bumpArg(); break; + } else if (lowerword == "quiet") { + beQuiet = true; } else if (lowerword == "version") { Options |= EOptionDumpVersions; } else if (lowerword == "help") { @@ -1108,7 +1111,8 @@ void CompileAndLinkShaderUnits(std::vector compUnits) if (! (Options & EOptionSuppressInfolog) && ! (Options & EOptionMemoryLeakMode)) { - PutsIfNonEmpty(compUnit.fileName[0].c_str()); + if (!beQuiet) + PutsIfNonEmpty(compUnit.fileName[0].c_str()); PutsIfNonEmpty(shader->getInfoLog()); PutsIfNonEmpty(shader->getInfoDebugLog()); } @@ -1615,6 +1619,8 @@ void usage() " --keep-uncalled | --ku don't eliminate uncalled functions\n" " --nan-clamp favor non-NaN operand in min, max, and clamp\n" " --no-storage-format | --nsf use Unknown image format\n" + " --quiet do not print anything to stdout, unless\n" + " requested by another option\n" " --reflect-strict-array-suffix use strict array suffix rules when\n" " reflecting\n" " --reflect-basic-array-suffix arrays of basic types will have trailing [0]\n"