stas 2003/03/25 22:11:56
Modified: perl-framework/Apache-Test/lib/Apache TestConfig.pm
Log:
change filter_args to accept arguments which aren't only key/value pairs,
but also tokens like 'FOO=1'
Revision Changes Path
1.147 +11 -5
httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfig.pm
Index: TestConfig.pm
===================================================================
RCS file:
/home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfig.pm,v
retrieving revision 1.146
retrieving revision 1.147
diff -u -r1.146 -r1.147
--- TestConfig.pm 24 Feb 2003 03:42:41 -0000 1.146
+++ TestConfig.pm 26 Mar 2003 06:11:55 -0000 1.147
@@ -73,13 +73,19 @@
push @pass, shift @filter;
}
- while (my($key, $val) = splice @filter, 0, 2) {
- if ($key =~ /^-?-?(.+)/ # optinal - or -- prefix
- && exists $wanted_args->{$1}) {
- $keep{$1} = $val;
+ while (@filter) {
+ my $key = shift @filter;
+ # optinal - or -- prefix
+ if ($key =~ /^-?-?(.+)/ && exists $wanted_args->{$1}) {
+ if (@filter) {
+ $keep{$1} = shift @filter;
+ }
+ else {
+ die "key $1 requires a matching value";
+ }
}
else {
- push @pass, $key, $val;
+ push @pass, $key;
}
}