add --color cli arg to override tty detection

This commit is contained in:
Andrew Kelley committed 2015-12-01 01:06:10 -07:00
1 parent 257cf09472
commit 29f24e3c50
9 files changed
+43 -11

No files matched your search

+2 -2
View File
@@ -8,8 +8,8 @@
#define GREEN "\x1b[32;1m"
#define RESET "\x1b[0m"
void print_err_msg(ErrorMsg *err) {
if (os_stderr_tty()) {
void print_err_msg(ErrorMsg *err, ErrColor color) {
if (color == ErrColorOn || (color == ErrColorAuto && os_stderr_tty())) {
fprintf(stderr, WHITE "%s:%d:%d: " RED "error:" WHITE " %s" RESET "\n",
buf_ptr(err->path),
err->line_start + 1, err->column_start + 1,