diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-03-25 13:25:55 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-03-25 13:25:55 -0400 |
| commit | 7994a4835b2340e12301f6897ae62e7447915f5b (patch) | |
| tree | 9bb67ff18c909b077cf2f959961dd328c45e5079 /src/tomo.c | |
| parent | dbf6d326adbf480a5c60eeaf2afd92b88e85eccb (diff) | |
Compiler errors should use USE_COLOR
Diffstat (limited to 'src/tomo.c')
| -rw-r--r-- | src/tomo.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -96,6 +96,10 @@ int main(int argc, char *argv[]) if (stat(compiler_path, &compiler_stat) != 0) err(1, "Could not find age of compiler"); + USE_COLOR = getenv("COLOR") ? strcmp(getenv("COLOR"), "1") == 0 : isatty(STDOUT_FILENO); + if (getenv("NO_COLOR") && getenv("NO_COLOR")[0] != '\0') + USE_COLOR = false; + if (register_printf_specifier('T', printf_type, printf_pointer_size)) errx(1, "Couldn't set printf specifier"); if (register_printf_specifier('W', printf_ast, printf_pointer_size)) |
