diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2019-10-25 09:38:40 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2019-10-25 09:38:40 +0200 |
commit | 73fd1a275b7ed039ef3ca18a3706692e9e95177a (patch) | |
tree | 1565fca68586c4c23ac6ceedc507f8aed93e7d13 /build2/b.cxx | |
parent | aca0c7906724b2c0b648c06604e60fc3164e6f6a (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.cxx | 14 |
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 (), |