1
0
mirror of https://github.com/stedolan/jq.git synced 2024-05-11 05:55:39 +00:00

Configure whether colour is displayed by default directly in source

This commit is contained in:
Stephen Dolan
2013-05-08 19:36:52 +01:00
parent 9d245c88c4
commit a511d03d85
2 changed files with 4 additions and 3 deletions

6
main.c
View File

@@ -74,8 +74,10 @@ static void process(jv value, int flags) {
jv_free(result);
} else {
int dumpopts;
#ifdef JQ_DEFAULT_ENABLE_COLOR
dumpopts = JQ_DEFAULT_ENABLE_COLOR ? JV_PRINT_COLOUR : 0;
/* Disable colour by default on Windows builds as Windows
terminals tend not to display it correctly */
#ifdef WIN32
dumpopts = 0;
#else
dumpopts = isatty(fileno(stdout)) ? JV_PRINT_COLOUR : 0;
#endif