diff options
author | Nico Williams <nico@cryptonector.com> | 2017-04-29 13:00:52 -0500 |
---|---|---|
committer | William Langford <wlangfor@gmail.com> | 2017-04-29 14:00:52 -0400 |
commit | 6d89e297febdbcbad4ecf201e56fc8ec99f67137 (patch) | |
tree | cc70c53bf330c65c8cabe10152c89ce9805c5e12 /src/main.c | |
parent | 32d8f2000a80c3702b04f3423180ebfeaa503eb7 (diff) |
Add JQ_COLORS env var for color config (fix #1252)
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -525,6 +525,9 @@ int main(int argc, char* argv[]) { if (options & COLOR_OUTPUT) dumpopts |= JV_PRINT_COLOR; if (options & NO_COLOR_OUTPUT) dumpopts &= ~JV_PRINT_COLOR; + if (getenv("JQ_COLORS") != NULL && !jq_set_colors(getenv("JQ_COLORS"))) + fprintf(stderr, "Failed to set $JQ_COLORS\n"); + if (jv_get_kind(lib_search_paths) == JV_KIND_NULL) { // Default search path list lib_search_paths = JV_ARRAY(jv_string("~/.jq"), |