aboutsummaryrefslogtreecommitdiff
path: root/build2/b.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2019-10-25 09:38:40 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2019-10-25 09:38:40 +0200
commit73fd1a275b7ed039ef3ca18a3706692e9e95177a (patch)
tree1565fca68586c4c23ac6ceedc507f8aed93e7d13 /build2/b.cxx
parentaca0c7906724b2c0b648c06604e60fc3164e6f6a (diff)
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.
Diffstat (limited to 'build2/b.cxx')
-rw-r--r--build2/b.cxx14
1 files changed, 11 insertions, 3 deletions
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<bool> (true) :
ops.no_progress () ? optional<bool> (false) : nullopt),
ops.no_line (),