From f7600f07eecbdac0a4400ca2bc39e3e9f5a53b1b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 8 Dec 2022 10:49:57 +0200 Subject: Add --[no]diag-color options (infrastructure only) --- libbuild2/utility.hxx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'libbuild2/utility.hxx') diff --git a/libbuild2/utility.hxx b/libbuild2/utility.hxx index c12fae7..e27eec2 100644 --- a/libbuild2/utility.hxx +++ b/libbuild2/utility.hxx @@ -129,6 +129,7 @@ namespace build2 init_diag (uint16_t verbosity, bool silent = false, optional progress = nullopt, + optional diag_color = nullopt, bool no_lines = false, bool no_columns = false, bool stderr_term = false); @@ -138,13 +139,23 @@ namespace build2 LIBBUILD2_SYMEXPORT extern bool silent; // --[no-]progress + // --[no-]diag-color // LIBBUILD2_SYMEXPORT extern optional diag_progress_option; + LIBBUILD2_SYMEXPORT extern optional diag_color_option; LIBBUILD2_SYMEXPORT extern bool diag_no_line; // --no-line LIBBUILD2_SYMEXPORT extern bool diag_no_column; // --no-column - LIBBUILD2_SYMEXPORT extern bool stderr_term; // True if stderr is a terminal. + // If stderr is not a terminal, then the value is absent (so can be used as + // bool). Otherwise, it is the value of the TERM environment variable (which + // can be NULL). + // + LIBBUILD2_SYMEXPORT extern optional stderr_term; + + // True if the color can be used on the stderr terminal. + // + LIBBUILD2_SYMEXPORT extern bool stderr_term_color; // Global state (verbosity, home/work directories, etc). -- cgit v1.1