From 73fd1a275b7ed039ef3ca18a3706692e9e95177a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 25 Oct 2019 09:38:40 +0200 Subject: Add --silent, remap verbosity 0 to 1 while building modules unless silent Failed that, we may have long periods of seemingly nothing happening (e.g., during implicit bdep sync) while we quietly update the module, which may look like things have hung up. --- build2/b.cxx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'build2/b.cxx') diff --git a/build2/b.cxx b/build2/b.cxx index e093641..4571567 100644 --- a/build2/b.cxx +++ b/build2/b.cxx @@ -237,9 +237,16 @@ main (int argc, char* argv[]) // auto verbosity = [] () { - return ops.verbose_specified () - ? ops.verbose () - : ops.V () ? 3 : ops.v () ? 2 : ops.quiet () ? 0 : 1; + uint16_t v ( + ops.verbose_specified () + ? ops.verbose () + : ops.V () ? 3 : ops.v () ? 2 : ops.quiet () || ops.silent () ? 0 : 1); + + if (ops.silent () && v != 0) + fail << "specified with -v, -V, or --verbose verbosity level " << v + << " is incompatible with --silent"; + + return v; }; // We want to be able to specify options, vars, and buildspecs in any @@ -423,6 +430,7 @@ main (int argc, char* argv[]) // Initialize the diagnostics state. // init_diag (verbosity (), + ops.silent (), (ops.progress () ? optional (true) : ops.no_progress () ? optional (false) : nullopt), ops.no_line (), -- cgit v1.1