aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/nant-color
diff options
context:
space:
mode:
authorSean Dague2008-07-10 00:05:21 +0000
committerSean Dague2008-07-10 00:05:21 +0000
commit9a06bf47b96a393a95b3a5348368a79f9570121f (patch)
tree7f35205e56c6bffe9d973278eb0007e1aa446d59 /nant-color
parentadded .gitignore which makes using git-svn easier (diff)
downloadopensim-SC_OLD-9a06bf47b96a393a95b3a5348368a79f9570121f.zip
opensim-SC_OLD-9a06bf47b96a393a95b3a5348368a79f9570121f.tar.gz
opensim-SC_OLD-9a06bf47b96a393a95b3a5348368a79f9570121f.tar.bz2
opensim-SC_OLD-9a06bf47b96a393a95b3a5348368a79f9570121f.tar.xz
added convenience makefile and nant-color script. I've had these
on my laptop forever, and others might find them useful to be part of the main tree.
Diffstat (limited to 'nant-color')
-rwxr-xr-xnant-color52
1 files changed, 52 insertions, 0 deletions
diff --git a/nant-color b/nant-color
new file mode 100755
index 0000000..ca5ea37
--- /dev/null
+++ b/nant-color
@@ -0,0 +1,52 @@
1#!/usr/bin/ruby
2
3
4def main
5 IO.popen("nant #{ARGV.join(' ')}") { |pipe|
6 pipe.sync = true
7 while str = pipe.gets
8 str.sub!(/\n+/, '')
9 puts colorize(str)
10 end
11 }
12end
13
14def clear
15 return "\e[0m"
16end
17
18def red(str)
19 return "\e[31m" + str + clear
20end
21
22def green(str)
23 return "\e[32m" + str + clear
24end
25
26def yellow(str)
27 return "\e[33m" + str + clear
28end
29
30def black
31 return "\e[30m"
32end
33
34def hide
35 return "\e[8m"
36end
37
38def bright
39 return "\e[1m"
40end
41
42def colorize(str)
43 str.sub!(/(error \w+:.*)/, red('\1'))
44 str.sub!(/(warning \w+:.*)/, yellow('\1'))
45
46 str.sub!(/(Build Succeeded)/i, green('\1'))
47 str.sub!(/(Compilation succeeded)/, green('\1'))
48 str.sub!(/(\d+ warning\(s\))/, yellow('\1'))
49 return str
50end
51
52main()