[tapx-dev] [commit][222] Split -c and --(no)color options because older Getopt:: Long versions can't handle a negatable switch with a short version.

andy at hexten.net andy at hexten.net
Fri Aug 10 16:05:14 BST 2007


Revision: 222
Author:   andy
Date:     2007-08-10 16:05:14 +0100 (Fri, 10 Aug 2007)

Log Message:
-----------
Split -c and --(no)color options because older Getopt::Long versions can't handle a negatable switch with a short version.

Modified Paths:
--------------
    trunk/bin/runtests

Modified: trunk/bin/runtests
===================================================================
--- trunk/bin/runtests	2007-08-10 14:09:55 UTC (rev 221)
+++ trunk/bin/runtests	2007-08-10 15:05:14 UTC (rev 222)
@@ -15,6 +15,7 @@
 # Allow cuddling the paths with the -I
 @ARGV = map { /^(-I)(.+)/ ? ( $1, $2 ) : $_ } @ARGV;
 my $color_default = -t STDOUT && !( $^O =~ /MSWin32/ );
+my $COLOR;
 
 Getopt::Long::Configure( 'no_ignore_case', 'bundling' );
 GetOptions(
@@ -23,7 +24,8 @@
     'l|lib'       => \my $LIB,
     'b|blib'      => \my $BLIB,
     's|shuffle'   => \my $SHUFFLE,
-    'c|color!'    => \my $COLOR,
+    'color!'      => \$COLOR,
+    'c'           => \$COLOR,
     'harness=s'   => \my $HARNESS,
     'formatter=s' => \my $FORMATTER,
     'r|recurse'   => \my $RECURSE,




More information about the tapx-dev mailing list