X-Git-Url: http://sjero.net/git/?a=blobdiff_plain;f=util%2Fparamcheck.pl;h=660cdb4f3080a76d3a00ab71f2c1a59a415b0a2e;hb=97787110a2b6e99f80b277dbffdbbc4b0d608a55;hp=5fd562b9898a25497d812dca9e8f44df0bedc0b6;hpb=4f16c7754c2d4507054004419538e2403ac09d96;p=wget diff --git a/util/paramcheck.pl b/util/paramcheck.pl index 5fd562b9..660cdb4f 100755 --- a/util/paramcheck.pl +++ b/util/paramcheck.pl @@ -1,6 +1,6 @@ #!/usr/bin/env perl -# Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc. +# Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -33,11 +33,11 @@ my $tex_content = read_file($tex_file); my @args = ([ $main_content, - qr/static \s+? struct \s+? cmdline_option \s+? option_data\[\] \s+? = \s+? \{ (.*?) \}\;/sx, + qr/static \s+? struct \s+? cmdline_option \s+? option_data\[\] \s+? = \s+? \{ (.+?) \}\;/sx, [ qw(long_name short_name type data argtype) ], ], [ $init_content, - qr/commands\[\] \s+? = \s+? \{ (.*?) \}\;/sx, + qr/commands\[\] \s+? = \s+? \{ (.+?) \}\;/sx, [ qw(name place action) ], ]); @@ -78,18 +78,18 @@ sub extract_entries my (@entries, %index, $i); foreach my $chunk (@$chunks) { - my ($args) = $chunk =~ /\{ \s+? (.*?) \s+? \}/sx; + my ($args) = $chunk =~ /\{ \s+? (.+?) \s+? \}/sx; next unless defined $args; my @args = map { tr/'"//d; $_ } map { - /\((.*?)\)/ ? $1 : $_ + /\((.+?)\)/ ? $1 : $_ } split /\,\s+/, $args; my $entry = { map { $_ => shift @args } @$names }; - ($entry->{line}) = $chunk =~ /^ \s+? (\{.*)/mx; + ($entry->{line}) = $chunk =~ /^ \s+? (\{.+)/mx; if ($chunk =~ /deprecated/i) { $entries[-1]->{deprecated} = true; } @@ -103,9 +103,9 @@ sub extract_entries push @entries, $entry; } - push @entries, \%index; + push @entries, { %index }; - return \@entries; + return [ @entries ]; } sub output_results @@ -281,7 +281,7 @@ sub emit_undocumented_opts while ($tex =~ /^\@item\w*? \s+? --([-a-z0-9]+)/gmx) { $tex_items{$1} = true; } - my ($help) = $main =~ /\n print_help .*? \{\n (.*) \n\} \n/sx; + my ($help) = $main =~ /\n print_help .*? \{\n (.+) \n\} \n/sx; while ($help =~ /--([-a-z0-9]+)/g) { $main_items{$1} = true; }