Fix options.pm
Francois Gouget
fgouget at free.fr
Mon Oct 25 07:57:06 CDT 2004
Changelog:
* tools/winapi/make_filter_options.pm
tools/winapi/options.pm
Fix the usage for non-boolean options, always print the description.
This fixes the output of 'make_filter --help'.
--
Francois Gouget fgouget at free.fr http://fgouget.free.fr/
Linux, WinNT, MS-DOS - also known as the Good, the Bad and the Ugly.
-------------- next part --------------
Index: tools/winapi/make_filter_options.pm
===================================================================
RCS file: /var/cvs/wine/tools/winapi/make_filter_options.pm,v
retrieving revision 1.4
diff -u -r1.4 make_filter_options.pm
--- tools/winapi/make_filter_options.pm 7 Oct 2004 04:20:41 -0000 1.4
+++ tools/winapi/make_filter_options.pm 25 Oct 2004 12:44:03 -0000
@@ -39,7 +39,7 @@
"make" => { default => "make",
parser => \&parse_value,
- description => "use which make" },
+ description => "Specifies the make command" },
"pedantic" => { default => 0, description => "be pedantic" },
);
Index: tools/winapi/options.pm
===================================================================
RCS file: /var/cvs/wine/tools/winapi/options.pm,v
retrieving revision 1.10
diff -u -r1.10 options.pm
--- tools/winapi/options.pm 27 Nov 2002 20:11:10 -0000 1.10
+++ tools/winapi/options.pm 25 Oct 2004 12:43:35 -0000
@@ -331,20 +333,20 @@
for my $name (sort(keys(%$options_long))) {
my $option = $$options_long{$name};
my $description = $$option{description};
- my $default = $$option{default};
+ my $parser = $$option{parser};
my $current = ${$self->{$$option{key}}};
my $value = $current;
my $command;
- if(ref($value) ne "HASH") {
+ if(!defined $parser) {
if($value) {
$command = "--no-$name";
} else {
$command = "--$name";
}
} else {
- if($value->{active}) {
+ if(ref($value) eq "HASH" && $value->{active}) {
$command = "--[no-]$name\[=<value>]";
} else {
$command = "--$name\[=<value>]";
@@ -352,23 +354,24 @@
}
$output->write($command);
- for (0..(($maxname - length($name) + 17) - (length($command) - length($name) + 1))) { $output->write(" "); }
- if(ref($value) ne "HASH") {
+ $output->write(" " x (($maxname - length($name) + 17) - (length($command) - length($name) + 1)));
+ if(!defined $parser) {
if($value) {
$output->write("Disable ");
} else {
$output->write("Enable ");
}
} else {
- if($value->{active}) {
- $output->write("(Disable) ");
- } else {
- $output->write("Enable ");
- }
- }
- if($default == $current) {
- $output->write("$description\n");
+ if(ref($value) eq "HASH")
+ {
+ if ($value->{active}) {
+ $output->write("(Disable) ");
+ } else {
+ $output->write("Enable ");
+ }
+ }
}
+ $output->write("$description\n");
}
}
More information about the wine-patches
mailing list