diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2022-12-08 10:49:57 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2022-12-08 10:49:57 +0200 |
commit | f7600f07eecbdac0a4400ca2bc39e3e9f5a53b1b (patch) | |
tree | 3bc35a46a68b41dab1148fdbac1d64b818b53960 /libbuild2/diagnostics.hxx | |
parent | e55ab94a6fa652c71cdb119dc1b269c836672930 (diff) |
Add --[no]diag-color options (infrastructure only)
Diffstat (limited to 'libbuild2/diagnostics.hxx')
-rw-r--r-- | libbuild2/diagnostics.hxx | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/libbuild2/diagnostics.hxx b/libbuild2/diagnostics.hxx index c048d5b..129e00d 100644 --- a/libbuild2/diagnostics.hxx +++ b/libbuild2/diagnostics.hxx @@ -401,15 +401,25 @@ namespace build2 using butl::diag_progress_lock; // Return true if progress is to be shown. The max_verb argument is the - // maximum verbosity level that this type of progress should be shown by - // default. + // maximum verbosity level that this type of progress should be shown at by + // default. If it is verb_never, then both min and max verbosity checks are + // omitted, assuming the caller takes care of that themselves. // inline bool show_progress (uint16_t max_verb) { return diag_progress_option ? *diag_progress_option - : stderr_term && verb >= 1 && verb <= max_verb; + : stderr_term && (max_verb == verb_never || + (verb >= 1 && verb <= max_verb)); + } + + // Diagnostics color. + // + inline bool + show_diag_color () + { + return diag_color_option ? *diag_color_option : stderr_term_color; } // Diagnostic facility. |