Respect NO_COLOR environment variable to disable color output
This commit is contained in:
1 parent
87e3dfddb8
commit
0615d4982c
2 files changed
+29
No files matched your search
@@ -588,6 +588,11 @@ int main(int argc, char* argv[]) {
|
||||
dumpopts |= JV_PRINT_COLOR;
|
||||
}
|
||||
#endif
|
||||
if (dumpopts & JV_PRINT_COLOR) {
|
||||
char *no_color = getenv("NO_COLOR");
|
||||
if (no_color != NULL && no_color[0] != '\0')
|
||||
dumpopts &= ~JV_PRINT_COLOR;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (options & SORTED_OUTPUT) dumpopts |= JV_PRINT_SORTED;
|
||||
|
||||
Reference in new issue
Block a user