mu: honor nocolor option

1. mu find hallo              --> color
2. mu find hallo | less       --> nocolor
3. NO_COLOR=yes mu find hallo --> nocolor

Fixes #2369.
This commit is contained in:
Dirk-Jan C. Binnema 2022-11-24 18:43:05 +02:00
parent 71162ee74f
commit 39a2c28777
1 changed files with 1 additions and 0 deletions

View File

@ -619,6 +619,7 @@ add_global_options(CLI::App& cli, Options& opts)
!::isatty(::fileno(stdout)) ||
!::isatty(::fileno(stderr)) ||
::getenv("NO_COLOR") != NULL;
opts.nocolor = default_no_color;
errno = 0;