# encoding: ascii
# api: powershell
# title: Colorize Subversion SVN
# description: Colorize Subversion SVN STAT output.
# version: 0.1
# type: function
# author: jim palmer
# license: CC0
# x-poshcode-id: 688
# x-archived: 2009-01-05T15:38:26
#
# Here�s a PowerShell function that you can use to make those numerous SVN STAT commands you run every day via the PowerShell CLI a little easier to read by adding colors.
#
## SVN STAT colorizer - http://www.overset.com/2008/11/18/colorized-subversion-svn-stat-powershell-function/
function ss () {
$c = @{ "A"="Magenta"; "D"="Red"; "C"="Yellow"; "G"="Blue"; "M"="Cyan"; "U"="Green"; "?"="DarkGray"; "!"="DarkRed" }
foreach ( $svno in svn stat ) {
if ( $c.ContainsKey($svno.ToString().SubString(0,1).ToUpper()) ) {
write-host $svno -Fore $c.Get_Item($svno.ToString().SubString(0,1).ToUpper()).ToString()
} else {
write-host $svno
}
}
}