when invoking g-cpan with invalid parameters (i.e., "g-cpan --help"), the
"Usage" message is displayed, as usual. However, in version 0.13-r1, the
definion of the color variables (${white}, ${green}, etc) is done after the
"exit_usage()" method is called, thus causing several warning messages --
complaining about uninitialized variables -- to be printed before the usage
message itself -- and, as a side effect, the usage message has no colors.
Reproducible: Always
Steps to Reproduce:
1. emerge g-cpan
2. g-cpan --help
Actual Results:
Before the usuage message was displayed, several "warnings" were printed, and
the usage message itself had no colors, as it was supposed to.
Expected Results:
See above.
The following patch should fix it:
62,67d61
< # Set colors here so we can use them at will anywhere :)
< my $green = color("bold green");
< my $white = color ("bold white");
< my $cyan = color("bold cyan");
< my $reset = color("reset");
<
81a76,81
> # Set colors here so we can use them at will anywhere :)
> my $green = color("bold green");
> my $white = color ("bold white");
> my $cyan = color("bold cyan");
> my $reset = color("reset");
>