aboutsummaryrefslogtreecommitdiff
path: root/samples/amber.cc
diff options
context:
space:
mode:
authordan sinclair <dj2@everburning.com>2019-02-21 13:47:33 -0500
committerGitHub <noreply@github.com>2019-02-21 13:47:33 -0500
commitef55db9f9fac6c4b34b494afff83bd0c0be6d180 (patch)
tree65e78d46c496bb24f569ca5623038c744990f85b /samples/amber.cc
parent9f9ce087f79a3012d3e364054be4f73e6be950b1 (diff)
downloadamber-ef55db9f9fac6c4b34b494afff83bd0c0be6d180.tar.gz
Flip the sample app to be less quiet. (#307)
The sample app outputting just an error code by default is confusing to users. The -s flag was originally created to turn on the summary mode. This CL removes -s from the help (but it still parses) and adds a -q flag instead. The quiet flag is used by the test runner to suppress the summary output.
Diffstat (limited to 'samples/amber.cc')
-rw-r--r--samples/amber.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/samples/amber.cc b/samples/amber.cc
index cb37de7..9bfa950 100644
--- a/samples/amber.cc
+++ b/samples/amber.cc
@@ -42,7 +42,7 @@ struct Options {
bool parse_only = false;
bool pipeline_create_only = false;
bool disable_validation_layer = false;
- bool show_summary = false;
+ bool quiet = false;
bool show_help = false;
bool show_version_info = false;
amber::EngineType engine = amber::kEngineTypeVulkan;
@@ -54,7 +54,7 @@ const char kUsage[] = R"(Usage: amber [options] SCRIPT [SCRIPTS...]
options:
-p -- Parse input files only; Don't execute.
-ps -- Parse input files, create pipelines; Don't execute.
- -s -- Print summary of pass/failure.
+ -q -- Disable summary output.
-d -- Disable validation layers.
-t <spirv_env> -- The target SPIR-V environment. Defaults to SPV_ENV_UNIVERSAL_1_0.
-i <filename> -- Write rendering to <filename> as a PNG image if it ends with '.png', or as a PPM image otherwise.
@@ -153,7 +153,10 @@ bool ParseArgs(const std::vector<std::string>& args, Options* opts) {
} else if (arg == "-d") {
opts->disable_validation_layer = true;
} else if (arg == "-s") {
- opts->show_summary = true;
+ // -s is deprecated but still recognized, it inverts the quiet flag.
+ opts->quiet = false;
+ } else if (arg == "-q") {
+ opts->quiet = true;
} else if (arg.size() > 0 && arg[0] == '-') {
std::cerr << "Unrecognized option " << arg << std::endl;
return false;
@@ -398,7 +401,7 @@ int main(int argc, const char** argv) {
}
}
- if (options.show_summary) {
+ if (!options.quiet) {
if (!failures.empty()) {
std::cout << "\nSummary of Failures:" << std::endl;