diff options
Diffstat (limited to 'tests/manpage-scan.pl')
-rwxr-xr-x | tests/manpage-scan.pl | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/tests/manpage-scan.pl b/tests/manpage-scan.pl index 41dfdec9c..219c4a463 100755 --- a/tests/manpage-scan.pl +++ b/tests/manpage-scan.pl @@ -6,11 +6,11 @@ # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # -# Copyright (C) 2016 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. +# Copyright (C) 2016 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms -# are also available at https://curl.haxx.se/docs/copyright.html. +# are also available at https://curl.se/docs/copyright.html. # # You may opt to use, copy, modify, merge, publish, distribute and/or sell # copies of the Software, and permit persons to whom the Software is @@ -31,7 +31,7 @@ # # src/tool_getparam.c lists all options curl can parse # docs/curl.1 documents all command line options -# src/tool_help.c outputs all options with curl -h +# src/tool_listhelp.c outputs all options with curl -h # - make sure they're all in sync # # Output all deviances to stderr. @@ -66,12 +66,19 @@ sub scanmanpage { my ($file, @words) = @_; open(M, "<$file"); - my @m = <M>; + my @m; + while(<M>) { + if($_ =~ /^\.IP (.*)/) { + my $w = $1; + # "unquote" minuses + $w =~ s/\\-/-/g; + push @m, $w; + } + } close(M); foreach my $m (@words) { - - my @g = grep(/^\.IP $m/, @m); + my @g = grep(/$m/, @m); if(!$g[0]) { print STDERR "Missing mention of $m in $file\n"; $errors++; @@ -140,7 +147,7 @@ my %opts = ( '--no-keepalive' => 1, '--no-progress-meter' => 1, - # pretend these options without -no exist in curl.1 and tool_help.c + # pretend these options without -no exist in curl.1 and tool_listhelp.c '--alpn' => 6, '--npn' => 6, '--eprt' => 6, @@ -150,7 +157,7 @@ my %opts = ( '--sessionid' => 6, '--progress-meter' => 6, - # deprecated options do not need to be in tool_help.c nor curl.1 + # deprecated options do not need to be in tool_listhelp.c nor curl.1 '--krb4' => 6, '--ftp-ssl' => 6, '--ftp-ssl-reqd' => 6, @@ -206,7 +213,8 @@ my @manpage; # store all parsed parameters while(<R>) { chomp; my $l= $_; - if(/^\.IP \"(-[^\"]*)\"/) { + $l =~ s/\\-/-/g; + if($l =~ /^\.IP \"(-[^\"]*)\"/) { my $str = $1; my $combo; if($str =~ /^-(.), --([a-z0-9.-]*)/) { @@ -228,7 +236,7 @@ close(R); ######################################################################### # parse the curl code that outputs the curl -h list -open(R, "<$root/src/tool_help.c") || +open(R, "<$root/src/tool_listhelp.c") || die "no input file"; my @toolhelp; # store all parsed parameters while(<R>) { @@ -278,10 +286,10 @@ foreach my $o (keys %opts) { $missing.= " curl.1"; } if($where & 4) { - $exists .= " tool_help.c"; + $exists .= " tool_listhelp.c"; } else { - $missing .= " tool_help.c"; + $missing .= " tool_listhelp.c"; } print STDERR "$o is not in$missing (but in$exists)\n"; |