nunit/nunit-console — pull request #14 by rprouse (2014-02-03 23:57:29+00:00)
Title: Color option for nunit-console

I added a `ColorSetter` class to the console and a new `--color` command line option.

The ColorSetter class is used in one of two ways,

Single `Console.WriteLine()` calls were converted to `ColorSetter.WriteLine()` which has an extra parameter, a ColorStyle enum. There are other static methods for Write and for WriteLabel which writes a label and a value in two colors. I did not add all of the overrides for WriteLine and Write because we only used them in a couple of places and String.Format does the job. The statics look like this,

```C#
ColorSetter.WriteLine(ColorStyle.Error, "Load failure: " + error.Message);
```

The second use of ColorSetter is to change all console output within a using statement. I use this to surround blocks like our error output. ColorSetter is disposable and resets the colors back to the defaults when it is Disposed. It looks like this,

```C#
if (resultState == "Failed")
{
using (new ColorSetter(ColorStyle.Failure))
WriteSingleResult(result);
}
```

Depending on feedback, I might want to change the following;

1. Should `ColorSetter` be renamed to `ColorConsole`?
2. I set the options to a static property on ColorSetter on startup so that I do not have to pass them in to every call. Is there a better way?
3. Should color be the default and should I change the option to `--nocolor`?