Colorized `cvs up` output

29 May, 2008 (16:07) | Computers

Found a post about colorized `cvs up` output but wasn’t very happy with the multiple pipes to sed so I thought I’d see what I could do.

Below is the awk code I came up with:

$1=="A" {printf("\033[1;32m%s\n",$0)}
$1=="C" {printf("\033[1;31m%s\n",$0)}
$1=="M" {printf("\033[1;34m%s\n",$0)}
$1=="U" {printf("\033[1;37m%s\n",$0)}
$1=="?" {printf("\033[1;36m%s\n",$0)}

Save it in a file named something like color-cvs.awk and use it like:

cvs -q up | awk -f color-cvs.awk

Doing it this way makes it easier to customize colors, I think.

Comments

Pingback from cvs | hottrends
Date: May 29, 2008, 8:19 pm

[...] Colorized `cvs up` output3 hours ago by Dave Found a post about colorized `cvs up` output but wasn’t very happy with the multiple pipes to sed so I thought I’d see what I could do. Below is the awk code I came up with: $1=="A" {printf("33[1;32m%sn",$0)} …ToasterWaffles - http://www.toasterwaffles.com [...]

Write a comment