From 671bceec51858cf18d86c5de2357a1771b8628c7 Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Mon, 29 Jan 2018 15:38:41 +0100 Subject: mless: support $NO_COLOR http://no-color.org/ --- mless | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'mless') diff --git a/mless b/mless index 395a8f8..91391ed 100755 --- a/mless +++ b/mless @@ -11,6 +11,10 @@ function so(s) { return sprintf("\033[1m%s\033[0m", s) } { print }' } +if [ -n "${NO_COLOR+set}" ]; then + colorscan() { cat -; } +fi + if [ "$1" = --filter ]; then if [ "$2" = //scan ]; then mscan : 2>/dev/null | colorscan -- cgit 1.4.1