diff options
author | Leah Neukirchen <leah@vuxu.org> | 2018-01-29 15:42:38 +0100 |
---|---|---|
committer | Leah Neukirchen <leah@vuxu.org> | 2018-01-29 15:42:38 +0100 |
commit | 8f0ac7c8abb4e0830d6cf72bbbd5f38c44b4266d (patch) | |
tree | af23b7802734655293005086e3a4849e69cc9918 | |
parent | a5dcf178247b7f446ad27ad12f03f80745d432d7 (diff) | |
download | lr-8f0ac7c8abb4e0830d6cf72bbbd5f38c44b4266d.tar.gz lr-8f0ac7c8abb4e0830d6cf72bbbd5f38c44b4266d.tar.xz lr-8f0ac7c8abb4e0830d6cf72bbbd5f38c44b4266d.zip |
support $NO_COLOR
http://no-color.org/
-rw-r--r-- | lr.1 | 3 | ||||
-rw-r--r-- | lr.c | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/lr.1 b/lr.1 index a673036..920b2fd 100644 --- a/lr.1 +++ b/lr.1 @@ -115,6 +115,9 @@ Don't enter directories. .It Fl G Colorize output to TTY. Use twice to force colorized output. +If the environment variable +.Ev NO_COLOR +is set, colors are never used. .It Fl X Output OSC 8 hyperlinks to TTY. Use twice to force hyperlinks. diff --git a/lr.c b/lr.c index 06b70ca..774b1d2 100644 --- a/lr.c +++ b/lr.c @@ -2468,6 +2468,8 @@ main(int argc, char *argv[]) if (Xflag == 1) Xflag = 0; } + if (getenv("NO_COLOR")) + Gflag = 0; analyze_format(); if (Uflag) { |