markpitchless / moosex-getopt-usage

Perl Moose Role to use with MooseX::Getopt to generate a coloured usage message from your classes meta
2 stars 2 forks source link

Fix coloring of multi-word options. #14

Open mschout opened 6 years ago

mschout commented 6 years ago

If you have a multi-word option such as:

has foo_bar => (is => 'ro', metaclass => 'Getopt', cmd_flag => 'get-opt');

Then this is handled with the getopt options --foo-bar

The colorized output only colors --foo and the -bar is uncolored because the formatter stops at the first non-word character.

Given that - is a common word separator for multi-word options, it makes sense to include this in the list of chars that are colored.