Merge pull request #2314 from marcinslusarz/quiet

Add --quiet option.
This commit is contained in:
John Kessenich 2020-07-06 05:36:34 -06:00 committed by GitHub
commit 309ffa294c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -107,6 +107,7 @@ bool SpvToolsDisassembler = false;
bool SpvToolsValidate = false; bool SpvToolsValidate = false;
bool NaNClamp = false; bool NaNClamp = false;
bool stripDebugInfo = false; bool stripDebugInfo = false;
bool beQuiet = false;
// //
// Return codes from main/exit(). // Return codes from main/exit().
@ -661,6 +662,8 @@ void ProcessArguments(std::vector<std::unique_ptr<glslang::TWorkItem>>& workItem
variableName = argv[1]; variableName = argv[1];
bumpArg(); bumpArg();
break; break;
} else if (lowerword == "quiet") {
beQuiet = true;
} else if (lowerword == "version") { } else if (lowerword == "version") {
Options |= EOptionDumpVersions; Options |= EOptionDumpVersions;
} else if (lowerword == "help") { } else if (lowerword == "help") {
@ -1108,6 +1111,7 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
if (! (Options & EOptionSuppressInfolog) && if (! (Options & EOptionSuppressInfolog) &&
! (Options & EOptionMemoryLeakMode)) { ! (Options & EOptionMemoryLeakMode)) {
if (!beQuiet)
PutsIfNonEmpty(compUnit.fileName[0].c_str()); PutsIfNonEmpty(compUnit.fileName[0].c_str());
PutsIfNonEmpty(shader->getInfoLog()); PutsIfNonEmpty(shader->getInfoLog());
PutsIfNonEmpty(shader->getInfoDebugLog()); PutsIfNonEmpty(shader->getInfoDebugLog());
@ -1615,6 +1619,8 @@ void usage()
" --keep-uncalled | --ku don't eliminate uncalled functions\n" " --keep-uncalled | --ku don't eliminate uncalled functions\n"
" --nan-clamp favor non-NaN operand in min, max, and clamp\n" " --nan-clamp favor non-NaN operand in min, max, and clamp\n"
" --no-storage-format | --nsf use Unknown image format\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" " --reflect-strict-array-suffix use strict array suffix rules when\n"
" reflecting\n" " reflecting\n"
" --reflect-basic-array-suffix arrays of basic types will have trailing [0]\n" " --reflect-basic-array-suffix arrays of basic types will have trailing [0]\n"