Skip to content

Commit

Permalink
Added documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jesper-friis committed Dec 19, 2023
1 parent e252dc5 commit 3dedced
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 5 additions & 2 deletions doc/user_guide/environment_variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,11 @@ Environment variables for controlling error handling
- "4" | "ignore-new" : ignore new error message
- otherwise : append new error message to the old one

- **ERR_COLOR**: If defined, error messages to stdout and stderr will be
written in colour.
- **ERR_COLOR**: Whether to print error messages in colour. May be:
- "0" | "never" : print errors colour-coded
- "1" | "always" : print errors not colour-coded
- otherwise : only print errors colour-coded if the error
stream is a terminal


Path handling when using the pre-packaged wheel (Linux, Windows)
Expand Down
7 changes: 3 additions & 4 deletions src/utils/err.c
Original file line number Diff line number Diff line change
Expand Up @@ -641,10 +641,9 @@ int err_get_color_coded()
if (tls->err_color_mode < 0) {
char *mode = getenv("ERR_COLOR");
tls->err_color_mode =
(!mode || !*mode) ? errColorAuto :
(strcmp(mode, "auto") == 0) ? errColorAuto :
(strcmp(mode, "always") == 0) ? errColorAlways :
(strcmp(mode, "never") == 0) ? errColorNever :
(!mode || !*mode) ? errColorAuto :
(strcmp(mode, "never") == 0 || strcmp(mode, "0") == 0) ? errColorNever :
(strcmp(mode, "always") == 0 || strcmp(mode,"1") == 0) ? errColorAlways :
errColorAuto;
}

Expand Down

0 comments on commit 3dedced

Please sign in to comment.