mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-28 01:49:23 -05:00
Merge topic 'stdio-no-color'
6aa604ef10 StdIo: Honor NO_COLOR environment variable
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10805
This commit is contained in:
@@ -101,6 +101,13 @@ void SetVT100Attrs(std::ostream& os, TermAttrSet const& attrs)
|
||||
}
|
||||
|
||||
auto const TermEnv = []() -> cm::optional<TermKind> {
|
||||
/* Disable color according to https://bixense.com/clicolors/ convention. */
|
||||
if (cm::optional<std::string> noColor =
|
||||
cmSystemTools::GetEnvVar("NO_COLOR")) {
|
||||
if (!noColor->empty() && *noColor != "0"_s) {
|
||||
return TermKind::None;
|
||||
}
|
||||
}
|
||||
/* Force color according to https://bixense.com/clicolors/ convention. */
|
||||
if (cm::optional<std::string> cliColorForce =
|
||||
cmSystemTools::GetEnvVar("CLICOLOR_FORCE")) {
|
||||
|
||||
Reference in New Issue
Block a user