<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>94759</bug_id>
          
          <creation_ts>2005-06-01 11:13 0000</creation_ts>
          <short_desc>g-cpan&apos;s &quot;usage&quot; message prints several warning due to uninitialized color variables</short_desc>
          <delta_ts>2005-06-01 13:40:04 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Portage Development</product>
          <component>Third-Party Tools</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          
          <priority>P2</priority>
          <bug_severity>trivial</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>gama@vettalabs.com</reporter>
          <assigned_to>mcummings@gentoo.org</assigned_to>
          

      

      
          <long_desc isprivate="0">
            <who>gama@vettalabs.com</who>
            <bug_when>2005-06-01 11:13:42 0000</bug_when>
            <thetext>when invoking g-cpan with invalid parameters (i.e., &quot;g-cpan --help&quot;), the
&quot;Usage&quot; message is displayed, as usual. However, in version 0.13-r1, the
definion of the color variables (${white}, ${green}, etc) is done after the
&quot;exit_usage()&quot; 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 &quot;warnings&quot; 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
&lt; # Set colors here so we can use them at will anywhere :)
&lt; my $green = color(&quot;bold green&quot;);
&lt; my $white = color (&quot;bold white&quot;);
&lt; my $cyan = color(&quot;bold cyan&quot;);
&lt; my $reset = color(&quot;reset&quot;);
&lt; 
81a76,81
&gt; # Set colors here so we can use them at will anywhere :)
&gt; my $green = color(&quot;bold green&quot;);
&gt; my $white = color (&quot;bold white&quot;);
&gt; my $cyan = color(&quot;bold cyan&quot;);
&gt; my $reset = color(&quot;reset&quot;);
&gt;</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>mcummings@gentoo.org</who>
            <bug_when>2005-06-01 11:28:56 0000</bug_when>
            <thetext>ack, i had this fixed at one point. expect in 13.01 (so i can avoid the whole 
mess i started with -r1). </thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>mcummings@gentoo.org</who>
            <bug_when>2005-06-01 13:40:04 0000</bug_when>
            <thetext>0.13.01 is in the tree now :) </thetext>
          </long_desc>
      
    </bug>

</bugzilla>