tests/scripts: call it 'manpage' (single word)
Mostly in comments Closes #14216
This commit is contained in:
parent
f504db8928
commit
5eba0a4b37
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
=begin comment
|
=begin comment
|
||||||
|
|
||||||
Converts a curldown file to nroff (man page).
|
Converts a curldown file to nroff (manpage).
|
||||||
|
|
||||||
=end comment
|
=end comment
|
||||||
=cut
|
=cut
|
||||||
@ -394,7 +394,7 @@ sub single {
|
|||||||
# convert backslash-'<' or '> to just the second character
|
# convert backslash-'<' or '> to just the second character
|
||||||
$d =~ s/\\([<>])/$1/g;
|
$d =~ s/\\([<>])/$1/g;
|
||||||
|
|
||||||
# mentions of curl symbols with man pages use italics by default
|
# mentions of curl symbols with manpages use italics by default
|
||||||
$d =~ s/((lib|)curl([^ ]*\(3\)))/\\fI$1\\fP/gi;
|
$d =~ s/((lib|)curl([^ ]*\(3\)))/\\fI$1\\fP/gi;
|
||||||
|
|
||||||
# backticked becomes italics
|
# backticked becomes italics
|
||||||
|
|||||||
@ -61,7 +61,7 @@ my $globals;
|
|||||||
|
|
||||||
my $indent = 4;
|
my $indent = 4;
|
||||||
|
|
||||||
# get the long name version, return the man page string
|
# get the long name version, return the manpage string
|
||||||
sub manpageify {
|
sub manpageify {
|
||||||
my ($k)=@_;
|
my ($k)=@_;
|
||||||
my $l;
|
my $l;
|
||||||
@ -319,7 +319,7 @@ sub render {
|
|||||||
# remove backticks from headers
|
# remove backticks from headers
|
||||||
$word =~ s/\`//g;
|
$word =~ s/\`//g;
|
||||||
|
|
||||||
# if there is a space, it needs quotes for man page
|
# if there is a space, it needs quotes for manpage
|
||||||
if(($word =~ / /) && $manpage) {
|
if(($word =~ / /) && $manpage) {
|
||||||
$word = "\"$word\"";
|
$word = "\"$word\"";
|
||||||
}
|
}
|
||||||
@ -1096,7 +1096,7 @@ sub mainpage {
|
|||||||
.\\" *
|
.\\" *
|
||||||
.\\" **************************************************************************
|
.\\" **************************************************************************
|
||||||
.\\"
|
.\\"
|
||||||
.\\" DO NOT EDIT. Generated by the curl project managen man page generator.
|
.\\" DO NOT EDIT. Generated by the curl project managen manpage generator.
|
||||||
.\\"
|
.\\"
|
||||||
.TH curl 1 "$date" "curl $version" "curl Manual"
|
.TH curl 1 "$date" "curl $version" "curl Manual"
|
||||||
HEADER
|
HEADER
|
||||||
|
|||||||
@ -15,7 +15,7 @@ none
|
|||||||
</server>
|
</server>
|
||||||
|
|
||||||
<name>
|
<name>
|
||||||
Man page syntax checks
|
Manpage syntax checks
|
||||||
</name>
|
</name>
|
||||||
|
|
||||||
<command type="perl">
|
<command type="perl">
|
||||||
|
|||||||
@ -194,7 +194,7 @@ option2.md:15:1:WARN: see-also a non-existing option: proto-default
|
|||||||
.\" *
|
.\" *
|
||||||
.\" **************************************************************************
|
.\" **************************************************************************
|
||||||
.\"
|
.\"
|
||||||
.\" DO NOT EDIT. Generated by the curl project managen man page generator.
|
.\" DO NOT EDIT. Generated by the curl project managen manpage generator.
|
||||||
.\"
|
.\"
|
||||||
.TH curl 1 "%DATE" "curl %VERNUM" "curl Manual"
|
.TH curl 1 "%DATE" "curl %VERNUM" "curl Manual"
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
|
|||||||
@ -24,12 +24,12 @@
|
|||||||
###########################################################################
|
###########################################################################
|
||||||
#
|
#
|
||||||
# Scan symbols-in-version (which is verified to be correct by test 1119), then
|
# Scan symbols-in-version (which is verified to be correct by test 1119), then
|
||||||
# verify that each option mention in there that should have its own man page
|
# verify that each option mention in there that should have its own manpage
|
||||||
# actually does.
|
# actually does.
|
||||||
#
|
#
|
||||||
# In addition, make sure that every current option to curl_easy_setopt,
|
# In addition, make sure that every current option to curl_easy_setopt,
|
||||||
# curl_easy_getinfo and curl_multi_setopt are also mentioned in their
|
# curl_easy_getinfo and curl_multi_setopt are also mentioned in their
|
||||||
# corresponding main (index) man page.
|
# corresponding main (index) manpage.
|
||||||
#
|
#
|
||||||
# src/tool_getparam.c lists all options curl can parse
|
# src/tool_getparam.c lists all options curl can parse
|
||||||
# docs/curl.1 documents all command line options
|
# docs/curl.1 documents all command line options
|
||||||
@ -227,8 +227,8 @@ while(<$r>) {
|
|||||||
close($r);
|
close($r);
|
||||||
|
|
||||||
#########################################################################
|
#########################################################################
|
||||||
# parse the curl.1 man page, extract all documented command line options
|
# parse the curl.1 manpage, extract all documented command line options
|
||||||
# The man page may or may not be rebuilt, so check both possible locations
|
# The manpage may or may not be rebuilt, so check both possible locations
|
||||||
open($r, "<", "$buildroot/docs/cmdline-opts/curl.1") || open($r, "<", "$root/docs/cmdline-opts/curl.1") ||
|
open($r, "<", "$buildroot/docs/cmdline-opts/curl.1") || open($r, "<", "$root/docs/cmdline-opts/curl.1") ||
|
||||||
die "failed getting curl.1";
|
die "failed getting curl.1";
|
||||||
my @manpage; # store all parsed parameters
|
my @manpage; # store all parsed parameters
|
||||||
|
|||||||
@ -24,7 +24,7 @@
|
|||||||
###########################################################################
|
###########################################################################
|
||||||
#
|
#
|
||||||
# scan manpages to find basic syntactic problems such as unbalanced \f
|
# scan manpages to find basic syntactic problems such as unbalanced \f
|
||||||
# codes or references to non-existing curl man pages.
|
# codes or references to non-existing curl manpages.
|
||||||
|
|
||||||
my $docsroot = $ARGV[0];
|
my $docsroot = $ARGV[0];
|
||||||
|
|
||||||
@ -76,7 +76,7 @@ sub file {
|
|||||||
my $man = "$1.3";
|
my $man = "$1.3";
|
||||||
$man =~ s/\\//g; # cut off backslashes
|
$man =~ s/\\//g; # cut off backslashes
|
||||||
if(!manpresent($man)) {
|
if(!manpresent($man)) {
|
||||||
print "error: $f:$line: referring to non-existing man page $man\n";
|
print "error: $f:$line: referring to non-existing manpage $man\n";
|
||||||
$errors++;
|
$errors++;
|
||||||
}
|
}
|
||||||
if($pre ne "I") {
|
if($pre ne "I") {
|
||||||
@ -95,7 +95,7 @@ sub file {
|
|||||||
my $man = "$1.3";
|
my $man = "$1.3";
|
||||||
$man =~ s/\\//g; # cut off backslashes
|
$man =~ s/\\//g; # cut off backslashes
|
||||||
if(!manpresent($man)) {
|
if(!manpresent($man)) {
|
||||||
print "error: $f:$line: referring to non-existing man page $man\n";
|
print "error: $f:$line: referring to non-existing manpage $man\n";
|
||||||
$errors++;
|
$errors++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,7 +23,7 @@
|
|||||||
#
|
#
|
||||||
###########################################################################
|
###########################################################################
|
||||||
#
|
#
|
||||||
# Scan man page(s) and detect some simple and yet common formatting mistakes.
|
# Scan manpage(s) and detect some simple and yet common formatting mistakes.
|
||||||
#
|
#
|
||||||
# Output all deviances to stderr.
|
# Output all deviances to stderr.
|
||||||
|
|
||||||
@ -137,7 +137,7 @@ sub scanmanpage {
|
|||||||
open(my $m, "<", "$file") ||
|
open(my $m, "<", "$file") ||
|
||||||
die "test1173.pl could not open $file";
|
die "test1173.pl could not open $file";
|
||||||
if($file =~ /[\/\\](CURL|curl_)([^\/\\]*).3/) {
|
if($file =~ /[\/\\](CURL|curl_)([^\/\\]*).3/) {
|
||||||
# This is a man page for libcurl. It requires an example unless it's
|
# This is a manpage for libcurl. It requires an example unless it's
|
||||||
# considered deprecated.
|
# considered deprecated.
|
||||||
$reqex = 1 unless defined $deprecated{'CURL'.$2};
|
$reqex = 1 unless defined $deprecated{'CURL'.$2};
|
||||||
if($1 eq "CURL") {
|
if($1 eq "CURL") {
|
||||||
@ -148,12 +148,12 @@ sub scanmanpage {
|
|||||||
while(<$m>) {
|
while(<$m>) {
|
||||||
chomp;
|
chomp;
|
||||||
if($_ =~ /^.so /) {
|
if($_ =~ /^.so /) {
|
||||||
# this man page is just a referral
|
# this manpage is just a referral
|
||||||
close($m);
|
close($m);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(($_ =~ /^\.SH SYNOPSIS/i) && ($reqex)) {
|
if(($_ =~ /^\.SH SYNOPSIS/i) && ($reqex)) {
|
||||||
# this is for libcurl man page SYNOPSIS checks
|
# this is for libcurl manpage SYNOPSIS checks
|
||||||
$insynop = 1;
|
$insynop = 1;
|
||||||
$inex = 0;
|
$inex = 0;
|
||||||
}
|
}
|
||||||
@ -254,7 +254,7 @@ sub scanmanpage {
|
|||||||
|
|
||||||
if($optpage && $SH && ($SH !~ /^(SYNOPSIS|EXAMPLE|NAME|SEE ALSO)/i) &&
|
if($optpage && $SH && ($SH !~ /^(SYNOPSIS|EXAMPLE|NAME|SEE ALSO)/i) &&
|
||||||
($_ =~ /(.*)(CURL(OPT_|MOPT_|INFO_|SHOPT_)[A-Z0-9_]*)/)) {
|
($_ =~ /(.*)(CURL(OPT_|MOPT_|INFO_|SHOPT_)[A-Z0-9_]*)/)) {
|
||||||
# an option with its own man page, check that it is tagged
|
# an option with its own manpage, check that it is tagged
|
||||||
# for linking
|
# for linking
|
||||||
my ($pref, $symbol) = ($1, $2);
|
my ($pref, $symbol) = ($1, $2);
|
||||||
if($deprecated{$symbol}) {
|
if($deprecated{$symbol}) {
|
||||||
@ -303,7 +303,7 @@ sub scanmanpage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($shcount < 3) {
|
if($shcount < 3) {
|
||||||
print STDERR "$file:$line too few man page sections!\n";
|
print STDERR "$file:$line too few manpage sections!\n";
|
||||||
$errors++;
|
$errors++;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
###########################################################################
|
###########################################################################
|
||||||
#
|
#
|
||||||
# Check that the deprecated statuses of functions and enum values in header
|
# Check that the deprecated statuses of functions and enum values in header
|
||||||
# files, man pages and symbols-in-versions are in sync.
|
# files, manpages and symbols-in-versions are in sync.
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
@ -45,8 +45,8 @@ my $errcode = 0;
|
|||||||
# x.yy.z Deprecated in version x.yy.z
|
# x.yy.z Deprecated in version x.yy.z
|
||||||
my %syminver; # Symbols-in-versions deprecations.
|
my %syminver; # Symbols-in-versions deprecations.
|
||||||
my %hdr; # Public header files deprecations.
|
my %hdr; # Public header files deprecations.
|
||||||
my %funcman; # Function man pages deprecations.
|
my %funcman; # Function manpages deprecations.
|
||||||
my %optman; # Option man pages deprecations.
|
my %optman; # Option manpages deprecations.
|
||||||
|
|
||||||
|
|
||||||
# Scan header file for public function and enum values. Flag them with
|
# Scan header file for public function and enum values. Flag them with
|
||||||
@ -141,7 +141,7 @@ sub scan_header {
|
|||||||
close $h;
|
close $h;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Scan function man page for options.
|
# Scan function manpage for options.
|
||||||
# Each option has to be declared as ".IP <option>" where <option> starts with
|
# Each option has to be declared as ".IP <option>" where <option> starts with
|
||||||
# the prefix. Flag each option with its deprecation version, if some.
|
# the prefix. Flag each option with its deprecation version, if some.
|
||||||
sub scan_man_for_opts {
|
sub scan_man_for_opts {
|
||||||
@ -180,7 +180,7 @@ sub scan_man_for_opts {
|
|||||||
close $m;
|
close $m;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Scan man page for deprecation in DESCRIPTION and/or AVAILABILITY sections.
|
# Scan manpage for deprecation in DESCRIPTION and/or AVAILABILITY sections.
|
||||||
sub scan_man_page {
|
sub scan_man_page {
|
||||||
my ($path, $sym, $table)=@_;
|
my ($path, $sym, $table)=@_;
|
||||||
my $version = "X";
|
my $version = "X";
|
||||||
@ -191,7 +191,7 @@ sub scan_man_page {
|
|||||||
|
|
||||||
while(<$fh>) {
|
while(<$fh>) {
|
||||||
if($_ =~ /\.so\s+man3\/(.*\.3\b)/) {
|
if($_ =~ /\.so\s+man3\/(.*\.3\b)/) {
|
||||||
# Handle man page inclusion.
|
# Handle manpage inclusion.
|
||||||
scan_man_page(dirname($path) . "/$1", $sym, $table);
|
scan_man_page(dirname($path) . "/$1", $sym, $table);
|
||||||
$version = exists($$table{$sym})? $$table{$sym}: $version;
|
$version = exists($$table{$sym})? $$table{$sym}: $version;
|
||||||
}
|
}
|
||||||
@ -213,7 +213,7 @@ sub scan_man_page {
|
|||||||
# Flag deprecation status.
|
# Flag deprecation status.
|
||||||
if($version ne "X" && $version ne "?") {
|
if($version ne "X" && $version ne "?") {
|
||||||
if($1 && $1 ne $version) {
|
if($1 && $1 ne $version) {
|
||||||
print "error: $sym man page lists unmatching deprecation versions $version and $1\n";
|
print "error: $sym manpage lists unmatching deprecation versions $version and $1\n";
|
||||||
$errcode++;
|
$errcode++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -261,18 +261,18 @@ for(@hfiles) {
|
|||||||
scan_header("$incdir/$_");
|
scan_header("$incdir/$_");
|
||||||
}
|
}
|
||||||
|
|
||||||
# Get function statuses from man pages.
|
# Get function statuses from manpages.
|
||||||
foreach my $sym (keys %hdr) {
|
foreach my $sym (keys %hdr) {
|
||||||
if($sym =~/^(?:curl|curlx)_\w/) {
|
if($sym =~/^(?:curl|curlx)_\w/) {
|
||||||
scan_man_page("$libdocdir/$sym.3", $sym, \%funcman);
|
scan_man_page("$libdocdir/$sym.3", $sym, \%funcman);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Get options from function man pages.
|
# Get options from function manpages.
|
||||||
scan_man_for_opts("$libdocdir/curl_easy_setopt.3", "CURLOPT");
|
scan_man_for_opts("$libdocdir/curl_easy_setopt.3", "CURLOPT");
|
||||||
scan_man_for_opts("$libdocdir/curl_easy_getinfo.3", "CURLINFO");
|
scan_man_for_opts("$libdocdir/curl_easy_getinfo.3", "CURLINFO");
|
||||||
|
|
||||||
# Get deprecation status from option man pages.
|
# Get deprecation status from option manpages.
|
||||||
foreach my $sym (keys %syminver) {
|
foreach my $sym (keys %syminver) {
|
||||||
if($sym =~ /^(?:CURLOPT|CURLINFO)_\w+$/) {
|
if($sym =~ /^(?:CURLOPT|CURLINFO)_\w+$/) {
|
||||||
scan_man_page("$libdocdir/opts/$sym.3", $sym, \%optman);
|
scan_man_page("$libdocdir/opts/$sym.3", $sym, \%optman);
|
||||||
|
|||||||
@ -89,7 +89,7 @@ scanmanpage($manpge);
|
|||||||
print "Result\n";
|
print "Result\n";
|
||||||
for my $h (sort @hnames) {
|
for my $h (sort @hnames) {
|
||||||
if(!$manfrom{$h}) {
|
if(!$manfrom{$h}) {
|
||||||
printf "$h from %s, not in man page\n", $wherefrom{$h};
|
printf "$h from %s, not in manpage\n", $wherefrom{$h};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user