Skip to content

Commit 309ffa2

Browse files
authored
Merge pull request KhronosGroup#2314 from marcinslusarz/quiet
Add --quiet option.
2 parents e7cb8bf + 245c30c commit 309ffa2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

StandAlone/StandAlone.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ bool SpvToolsDisassembler = false;
107107
bool SpvToolsValidate = false;
108108
bool NaNClamp = false;
109109
bool stripDebugInfo = false;
110+
bool beQuiet = false;
110111

111112
//
112113
// Return codes from main/exit().
@@ -661,6 +662,8 @@ void ProcessArguments(std::vector<std::unique_ptr<glslang::TWorkItem>>& workItem
661662
variableName = argv[1];
662663
bumpArg();
663664
break;
665+
} else if (lowerword == "quiet") {
666+
beQuiet = true;
664667
} else if (lowerword == "version") {
665668
Options |= EOptionDumpVersions;
666669
} else if (lowerword == "help") {
@@ -1108,7 +1111,8 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
11081111

11091112
if (! (Options & EOptionSuppressInfolog) &&
11101113
! (Options & EOptionMemoryLeakMode)) {
1111-
PutsIfNonEmpty(compUnit.fileName[0].c_str());
1114+
if (!beQuiet)
1115+
PutsIfNonEmpty(compUnit.fileName[0].c_str());
11121116
PutsIfNonEmpty(shader->getInfoLog());
11131117
PutsIfNonEmpty(shader->getInfoDebugLog());
11141118
}
@@ -1615,6 +1619,8 @@ void usage()
16151619
" --keep-uncalled | --ku don't eliminate uncalled functions\n"
16161620
" --nan-clamp favor non-NaN operand in min, max, and clamp\n"
16171621
" --no-storage-format | --nsf use Unknown image format\n"
1622+
" --quiet do not print anything to stdout, unless\n"
1623+
" requested by another option\n"
16181624
" --reflect-strict-array-suffix use strict array suffix rules when\n"
16191625
" reflecting\n"
16201626
" --reflect-basic-array-suffix arrays of basic types will have trailing [0]\n"

0 commit comments

Comments
 (0)