The registry class now forwards its with_color option to the print_help() function, so ./tests --color never --help prints the help text without color codes.
The command-line parser now parses arguments in two passes. The first pass looks only at color options, silently ignoring any problem, then changes the color configuration as specified. The second pass looks again at all options, and reports any problem using the color options configured in the first pass. This means that, for example, ./tests --color never --verbosity babbling will report the unknown babbling value without using color codes.
Note that, in both cases, argument ordering remains irrelevant, so --color never --help and --help --color never produces the same output.
This PR fixes #147:
registry
class now forwards itswith_color
option to theprint_help()
function, so./tests --color never --help
prints the help text without color codes../tests --color never --verbosity babbling
will report the unknownbabbling
value without using color codes.Note that, in both cases, argument ordering remains irrelevant, so
--color never --help
and--help --color never
produces the same output.