diff --git a/src/cfg/opt.c b/src/cfg/opt.c index 3529ded..f45613c 100644 --- a/src/cfg/opt.c +++ b/src/cfg/opt.c @@ -234,13 +234,14 @@ void print_help(void) { " --print-ir print resulting LLVM-IR to a file", " --mode=[app|lib] set the compilation mode to either application or library", " --output=name name of output files without extension", - " --link-paths=[paths,] set a list of directories to for libraries in" + " --link-paths=[paths,] set a list of directories to for libraries in", "Options:", " --verbose print logs with level information or higher", " --debug print debug logs (if not disabled at compile time)", " --version print the version", - " --list-targets print a list of all available targets supported" - " --help print this help dialog" + " --list-targets print a list of all available targets supported", + " --help print this help dialog", + " --color-always always colorize output" }; for (unsigned int i = 0; i < sizeof(lines) / sizeof(const char *); i++) { diff --git a/src/cfg/opt.h b/src/cfg/opt.h index 2f01c23..c319d9f 100644 --- a/src/cfg/opt.h +++ b/src/cfg/opt.h @@ -19,7 +19,7 @@ typedef struct TargetLinkConfig_t { // name of object files to link GArray* object_file_names; -} TargetLinktConfig; +} TargetLinkConfig; typedef enum TargetCompilationMode_t { // output an executable binary diff --git a/src/sys/col.c b/src/sys/col.c index 76260ec..2e0cabb 100644 --- a/src/sys/col.c +++ b/src/sys/col.c @@ -3,6 +3,7 @@ #include #include #include +#include #ifdef __unix__ #include @@ -55,6 +56,10 @@ void enable_ansi_colors() { int stdout_supports_ansi_esc() { + if (is_option_set("color-always")) { + return ANSI_ENABLED; + } + #ifdef __unix__ // check if TTY if (isatty(STDOUT_FILENO)) {