diff options
author | Jan Niklas Hasse <jhasse@bixense.com> | 2019-08-02 13:04:39 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-02 13:04:39 (GMT) |
commit | 70c8d75055b4fcb0ee6d9a41b908c554534725f6 (patch) | |
tree | dbde439bdc7fbd066454e9b8c8cd80c3b27240aa /src/build.cc | |
parent | 20af31d586c1f1bddeaad0583adc17933d5465ce (diff) | |
parent | 85038a5947183e0ead7bd81d7b481228e1e0d13a (diff) | |
download | Ninja-70c8d75055b4fcb0ee6d9a41b908c554534725f6.zip Ninja-70c8d75055b4fcb0ee6d9a41b908c554534725f6.tar.gz Ninja-70c8d75055b4fcb0ee6d9a41b908c554534725f6.tar.bz2 |
Merge pull request #1508 from mqudsi/colored_fail
Emit "FAILED: " in red if terminal supports ANSI color output
Diffstat (limited to 'src/build.cc')
-rw-r--r-- | src/build.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/build.cc b/src/build.cc index a055738..8ef88b5 100644 --- a/src/build.cc +++ b/src/build.cc @@ -139,7 +139,11 @@ 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"); } |