diff options
author | Mahmoud Al-Qudsi <mqudsi@neosmart.net> | 2018-12-05 20:54:20 (GMT) |
---|---|---|
committer | Mahmoud Al-Qudsi <mqudsi@neosmart.net> | 2018-12-05 20:54:20 (GMT) |
commit | 811b864045f1c440fe21a56802e7e20981578d6f (patch) | |
tree | becaf8f1a9758130176668598919309f0beb96d5 /src/build.cc | |
parent | b735f796cd00c7f49531e248961fd9c4bde04404 (diff) | |
download | Ninja-811b864045f1c440fe21a56802e7e20981578d6f.zip Ninja-811b864045f1c440fe21a56802e7e20981578d6f.tar.gz Ninja-811b864045f1c440fe21a56802e7e20981578d6f.tar.bz2 |
Emit "FAILED: " in red if terminal supports ANSI color output
Diffstat (limited to 'src/build.cc')
-rw-r--r-- | src/build.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/build.cc b/src/build.cc index b392803..c1a88e9 100644 --- a/src/build.cc +++ b/src/build.cc @@ -138,7 +138,10 @@ void BuildStatus::BuildEdgeFinished(Edge* edge, o != edge->outputs_.end(); ++o) outputs += (*o)->path() + " "; - printer_.PrintOnNewLine("FAILED: " + outputs + "\n"); + if (printer_.supports_color()) + printer_.PrintOnNewLine("\x1B[31m" "FAILED: " "\x1B[0m" + outputs + "\n"); + else + printer_.PrintOnNewLine("FAILED: " + outputs + "\n"); printer_.PrintOnNewLine(edge->EvaluateCommand() + "\n"); } |