├── wac.exe ├── printcol.bat ├── COPYING ├── README.textile └── wac.c /wac.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aslakhellesoy/wac/HEAD/wac.exe -------------------------------------------------------------------------------- /printcol.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | echo [1m[31mred bold[0m 3 | echo [0m[31mred regular[0m 4 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 2 | Version 2, December 2004 3 | 4 | Copyright (C) 2009 Aslak Hellesøy 5 | Everyone is permitted to copy and distribute verbatim or modified 6 | copies of this license document, and changing it is allowed as long 7 | as the name is changed. 8 | 9 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 10 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 11 | 12 | 0. You just DO WHAT THE FUCK YOU WANT TO. 13 | 14 | -------------------------------------------------------------------------------- /README.textile: -------------------------------------------------------------------------------- 1 | h1. wac - Windows ANSI Color 2 | 3 | wac.exe is a small command line utility that lets you use ANSI colors on Windows. This will print nice colors: 4 | 5 |
6 | printcol.bat | wac 7 |8 | 9 | This will not: 10 | 11 |
12 | printcol.bat 13 |14 | 15 | h2. Why wac? 16 | 17 | Some command line tools (like "Cucumber":http://cukes.info) like to print ANSI colors. 18 | Since Windows has no idea what ANSI colors are, all you'll see is gibberish. Unless 19 | you use wac. 20 | 21 | h2. But we have Win32::Console 22 | 23 | I know that Perl, Ruby, Python etc have native libraries that will do ANSI coloring on Windows, 24 | but not all platforms have that. If you're using e.g. JRuby on Windows there is no such 25 | library. So wac will save you. 26 | 27 | h2. Download/Installation 28 | 29 | Just download "wac.exe":http://github.com/aslakhellesoy/wac/raw/master/wac.exe and put it somewhere on your PATH. 30 | 31 | h2. How does it work? 32 | 33 | wac.exe reads from STDIN and prints to STDOUT. While doing that it looks for ANSI color codes, and if it finds one, 34 | it sets the console color accordingly and strips away the color code from the output. 35 | 36 | h2. How do I build it? 37 | 38 | Just get MinGW and run: 39 | 40 |
41 | gcc -o wac wac.c 42 |43 | 44 | h2. Why is it in C? 45 | 46 | Because it's easy to change colors on Windows with C. 47 | 48 | h2. Why is the C code so bad? 49 | 50 | Because I never do C. Feel free to improve that. 51 | 52 | h2. I have found a bug 53 | 54 | Great. Just fork this Git repo, clone your fork and fix it. 55 | When you have pushed your changes back to your repo, send me a pull request. 56 | 57 | h2. I have found a bug, but I don't know C. 58 | 59 | I don't know C either. Find someone who does. 60 | -------------------------------------------------------------------------------- /wac.c: -------------------------------------------------------------------------------- 1 | #include