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-options.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-options.cxx')
-rw-r--r-- | build2/b-options.cxx | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/build2/b-options.cxx b/build2/b-options.cxx index 878eb25..dc6b939 100644 --- a/build2/b-options.cxx +++ b/build2/b-options.cxx @@ -650,6 +650,7 @@ namespace build2 : v_ (), V_ (), quiet_ (), + silent_ (), verbose_ (1), verbose_specified_ (false), stat_ (), @@ -777,6 +778,12 @@ namespace build2 this->quiet_, a.quiet_); } + if (a.silent_) + { + ::build2::cl::parser< bool>::merge ( + this->silent_, a.silent_); + } + if (a.verbose_specified_) { ::build2::cl::parser< uint16_t>::merge ( @@ -957,20 +964,28 @@ namespace build2 os << "\033[1mOPTIONS\033[0m" << ::std::endl; os << std::endl - << "\033[1m-v\033[0m Print actual commands being executed. This is equivalent" << ::std::endl - << " to \033[1m--verbose 2\033[0m." << ::std::endl; + << "\033[1m-v\033[0m Print actual commands being executed. This options is" << ::std::endl + << " equivalent to \033[1m--verbose 2\033[0m." << ::std::endl; + + os << std::endl + << "\033[1m-V\033[0m Print all underlying commands being executed. This" << ::std::endl + << " options is equivalent to \033[1m--verbose 3\033[0m." << ::std::endl; os << std::endl - << "\033[1m-V\033[0m Print all underlying commands being executed. This is" << ::std::endl - << " equivalent to \033[1m--verbose 3\033[0m." << ::std::endl; + << "\033[1m--quiet\033[0m|\033[1m-q\033[0m Run quietly, only printing error messages in most" << ::std::endl + << " contexts. In certain contexts (for example, while" << ::std::endl + << " updating build system modules) this verbosity level may" << ::std::endl + << " be ignored. Use --silent\033[0m to run quietly in all contexts." << ::std::endl + << " This option is equivalent to \033[1m--verbose 0\033[0m." << ::std::endl; os << std::endl - << "\033[1m--quiet\033[0m|\033[1m-q\033[0m Run quietly, only printing error messages. This is" << ::std::endl - << " equivalent to \033[1m--verbose 0\033[0m." << ::std::endl; + << "\033[1m--silent\033[0m Run quietly, only printing error messages in all" << ::std::endl + << " contexts." << ::std::endl; os << std::endl << "\033[1m--verbose\033[0m \033[4mlevel\033[0m Set the diagnostics verbosity to \033[4mlevel\033[0m between 0 and 6." << ::std::endl - << " Level 0 disables any non-error messages while level 6" << ::std::endl + << " Level 0 disables any non-error messages (but see the" << ::std::endl + << " difference between --quiet\033[0m and --silent\033[0m) while level 6" << ::std::endl << " produces lots of information, with level 1 being the" << ::std::endl << " default. The following additional types of diagnostics" << ::std::endl << " are produced at each level:" << ::std::endl @@ -1168,6 +1183,8 @@ namespace build2 &::build2::cl::thunk< options, bool, &options::quiet_ >; _cli_options_map_["-q"] = &::build2::cl::thunk< options, bool, &options::quiet_ >; + _cli_options_map_["--silent"] = + &::build2::cl::thunk< options, bool, &options::silent_ >; _cli_options_map_["--verbose"] = &::build2::cl::thunk< options, uint16_t, &options::verbose_, &options::verbose_specified_ >; |