jatoben/CommandLine

ANSI color for ParseError.description & printUsage()

beltex opened this issue · 1 comments

Just a nice to have, nothing critical! :)

Have an option for the CommandLine class to turn on ANSI color. This would apply to error messages (ParseError.description), which could be in red for example, and to printUsage(), in which color is applied to shortFlag, longFlag, and the helpMessage (Usage line too?). Here's an example of what that might look like.

dshb-ansi-color

This just requires pre-appending a print statement with an escape code to turn on a particular color, and appending the off code. If there is interest in adding this I'd be happy to submit a pull request.

This looks like it could be a nice addition, I'd be interested in a PR 👍