From 601f0a2d09c90736143c227b0deded2a64dfa27b Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Mon, 26 Feb 2018 18:10:31 +0100 Subject: [PATCH] bin/xbps-query: support $NO_COLOR Closes: #273 [via git-merge-pr] --- bin/xbps-query/show-info-files.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/xbps-query/show-info-files.c b/bin/xbps-query/show-info-files.c index 41cfd161..dd0b5ab6 100644 --- a/bin/xbps-query/show-info-files.c +++ b/bin/xbps-query/show-info-files.c @@ -135,7 +135,7 @@ show_pkg_info_one(xbps_dictionary_t d, const char *keys) int v_tty = isatty(STDOUT_FILENO); bool raw; - if (v_tty) { + if (v_tty && !getenv("NO_COLOR")) { bold = _BOLD; reset = _RESET; } else { @@ -177,7 +177,7 @@ show_pkg_info(xbps_dictionary_t dict) const char *keyname, *bold, *reset; int v_tty = isatty(STDOUT_FILENO); - if (v_tty) { + if (v_tty && !getenv("NO_COLOR")) { bold = _BOLD; reset = _RESET; } else {