Add make colorizer
authorColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Tue, 28 Sep 2010 00:47:20 +0000 (17:47 -0700)
committerColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Tue, 28 Sep 2010 00:47:20 +0000 (17:47 -0700)
comake [new file with mode: 0755]

diff --git a/comake b/comake
new file mode 100755 (executable)
index 0000000..6f13e12
--- /dev/null
+++ b/comake
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+# Colors
+_ESC="$(echo -en '\e')"
+C_NULL="${_ESC}[00;00m"
+C_RED="${_ESC}[31;01m"
+C_GREEN="${_ESC}[32;01m"
+C_YELLOW="${_ESC}[33;01m"
+C_LIGHTBLUE="${_ESC}[36;01m"
+
+exec make "$@" 2>&1 | sed \
+        -e "s/\(^make.*\)/${C_LIGHTBLUE}\1${C_NULL}/" \
+        -e "s/\(.* [Ee]rror:.*\)/${C_RED}\1${C_NULL}/" \
+        -e "s/\(.* [Ww]arning:.*\)/${C_YELLOW}\1${C_NULL}/"