Mpdreamz / shellprogressbar

ShellProgressBar - display progress in your console application
MIT License
1.44k stars 134 forks source link

Adds option to configure the Foreground Done Color #97

Closed gfs closed 2 years ago

gfs commented 2 years ago

Adds an option to configure the Foreground Done Color in the same Style as the configurable Foreground color. Adds an example for its usage.

Motivation: Sometimes a task may fail, but the Done color must be configured ahead of time. The color of the progress bar may then mislead the user into thinking the process was successful when it was not.

Mpdreamz commented 2 years ago

Thanks for the PR @gfs

I updated it slightly so that error state is modeled a bit more explicitly

Adds ForegroundColorError as another option that can be toggled through pbar.ObservedError = true or pbar.WriteErrorLine()

This way you don't need to call .Finished() before being able to set the done color.

gfs commented 2 years ago

Looks great - I like the explicit error option. Looking forward to trying it out when it hits nuget!

Mpdreamz commented 2 years ago

New version should be up! Thanks again for the PR :)