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:
@@ -45,4 +45,3 @@ AC_CONFIG_FILES([Makefile])
|
|||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
|
||||||
|
|
||||||
dnl FIXME should disable colour output on windows somehow
|
|
||||||
|
|||||||
6
main.c
6
main.c
@@ -74,8 +74,10 @@ static void process(jv value, int flags) {
|
|||||||
jv_free(result);
|
jv_free(result);
|
||||||
} else {
|
} else {
|
||||||
int dumpopts;
|
int dumpopts;
|
||||||
#ifdef JQ_DEFAULT_ENABLE_COLOR
|
/* Disable colour by default on Windows builds as Windows
|
||||||
dumpopts = JQ_DEFAULT_ENABLE_COLOR ? JV_PRINT_COLOUR : 0;
|
terminals tend not to display it correctly */
|
||||||
|
#ifdef WIN32
|
||||||
|
dumpopts = 0;
|
||||||
#else
|
#else
|
||||||
dumpopts = isatty(fileno(stdout)) ? JV_PRINT_COLOUR : 0;
|
dumpopts = isatty(fileno(stdout)) ? JV_PRINT_COLOUR : 0;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user