about summary refs log tree commit diff
path: root/lr.c
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2016-02-01 22:22:49 +0100
committerChristian Neukirchen <chneukirchen@gmail.com>2016-02-01 22:22:49 +0100
commitbe177ab6c880d954338aabfc8eb3d44b2d0ff2e6 (patch)
tree6579e216a2e27cae914a8d74c82faa9b7eebd72b /lr.c
parentacfbb485b95328b4ded71942c4ac83996e212a22 (diff)
downloadlr-be177ab6c880d954338aabfc8eb3d44b2d0ff2e6.tar.gz
lr-be177ab6c880d954338aabfc8eb3d44b2d0ff2e6.tar.xz
lr-be177ab6c880d954338aabfc8eb3d44b2d0ff2e6.zip
don't colorize when stdout is not a tty, except when -G is passed multiple times
Diffstat (limited to 'lr.c')
-rw-r--r--lr.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lr.c b/lr.c
index 61d4e38..808e741 100644
--- a/lr.c
+++ b/lr.c
@@ -1640,6 +1640,9 @@ main(int argc, char *argv[])
 			exit(2);
 		}
 
+	if (Gflag == 1 && !isatty(1))
+		Gflag = 0;
+
 	analyze_format();
 
 	if (optind == argc) {