Skip to content

Commit

Permalink
param log-nocolor->log-color=no
Browse files Browse the repository at this point in the history
when not specified to "no", do the opposite - force color output
  • Loading branch information
MartinPulec committed Jul 17, 2023
1 parent 9a89b7d commit bc25340
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/utils/color_out.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,17 +128,18 @@ static bool isMsysPty(int fd) {
// conditional include here (and below) is to allow compilation outside UG
// without the need to link with host.o, which seems to be tricky
#ifdef HAVE_CONFIG_H
ADD_TO_PARAM("log-nocolor", "* log-nocolor\n"
" Force disable ANSI text formatting.\n");
ADD_TO_PARAM("log-color", "* log-color[=no]\n"
" Force enable/disable ANSI text formatting.\n");
#endif
/**
* @returns whether stdout can process ANSI escape sequences
*/
bool color_output_init() {
#ifdef HAVE_CONFIG_H
if(get_commandline_param("log-nocolor")){
color_stdout = false;
return false;
const char *const param_val = get_commandline_param("log-color");
if (param_val != nullptr) {
color_stdout = strcmp(param_val, "no") != 0;
return color_stdout;
}
#endif
#ifdef _WIN32
Expand Down

0 comments on commit bc25340

Please sign in to comment.