- enforce the leading --? for configuration options for ./t/TEST
- allow the leading --? for filter_args to be consistent, so now
  perl Makefile.PL -apxs ...
  can be called, consistently with ./t/TEST

issues:
- I cannot enforce --? in filter_args (first file in the patch), since
it's also used for parsing args from the test calls, and they need to be
fixed as well. I think it's a good thing to *always* using leading - in
the keys. Makes thing much easier to understand.

Index: Apache-Test/lib/Apache/TestConfig.pm
===================================================================
RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfig.pm,v
retrieving revision 1.69
diff -u -r1.69 TestConfig.pm
--- Apache-Test/lib/Apache/TestConfig.pm        2001/10/05 23:44:16     1.69
+++ Apache-Test/lib/Apache/TestConfig.pm        2001/10/06 08:11:25
@@ -65,8 +65,9 @@
     }

     while (my($key, $val) = splice @filter, 0, 2) {
-        if ($wanted_args->{$key}) {
-            $keep{$key} = $val;
+        if ($key =~ /^-?-?(.+)/ # optinal - or -- prefix
+            && exists $wanted_args->{$1}) {
+            $keep{$1} = $val;
         }
         else {
             push @pass, $key, $val;
Index: Apache-Test/lib/Apache/TestRun.pm
===================================================================
RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestRun.pm,v
retrieving revision 1.52
diff -u -r1.52 TestRun.pm
--- Apache-Test/lib/Apache/TestRun.pm   2001/09/22 07:21:58     1.52
+++ Apache-Test/lib/Apache/TestRun.pm   2001/10/06 08:11:25
@@ -145,10 +145,10 @@
     my @argv = ();
     while (@ARGV) {
         my $val = shift @ARGV;
-        $val =~ s/^--?//;
         # a known config option?
-        if (exists $Apache::TestConfig::Usage{lc $val}) {
-            $conf_opts{lc $val} = shift @ARGV || '';
+        if ($val =~ /^--?(.+)/ # must have a leading - or --
+            && exists $Apache::TestConfig::Usage{lc $1}) {
+            $conf_opts{lc $1} = shift @ARGV || '';
         }
         else {
             push @argv, $val;




_____________________________________________________________________
Stas Bekman             JAm_pH      --   Just Another mod_perl Hacker
http://stason.org/      mod_perl Guide   http://perl.apache.org/guide
mailto:[EMAIL PROTECTED]  http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to