docs: make each libcurl man specify protocol(s)

The mandatory header now has a mandatory list of protocols for which the
manpage is relevant.

Most man pages already has a "PROTOCOLS" section, but this introduces a
stricter way to specify the relevant protocols.

cd2nroff verifies that at least one protocol is mentioned (which can be
`*`).

This information is not used just yet, but A) the PROTOCOLS section can
now instead get generated and get a unified wording across all manpages
and B) this allows us to more reliably filter/search for protocol
specific manpages/options.

Closes #13166
This commit is contained in:
Daniel Stenberg 2024-03-21 11:50:20 +01:00
parent 98f67a6145
commit b935fd4a07
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
498 changed files with 1117 additions and 2 deletions

View file

@ -98,6 +98,7 @@ sub outseealso {
sub single {
my @seealso;
my @proto;
my $d;
my ($f)=@_;
my $copyright;
@ -105,6 +106,7 @@ sub single {
my $fh;
my $line;
my $salist;
my $protolist;
my $section;
my $source;
my $spdx;
@ -150,12 +152,24 @@ sub single {
return 2;
}
$salist = 1;
$protolist = 0;
}
elsif(/^Protocol:/i) {
$salist = 0;
$protolist = 1;
}
elsif(/^ +- (.*)/i) {
# the only list we support is the see-also
# the only lists we support are see-also and protocol
if($salist) {
push @seealso, $1;
}
elsif($protolist) {
push @proto, $1;
}
else {
print STDERR "$f:$line:1:ERROR: list item without owner?\n";
return 2;
}
}
# REUSE-IgnoreStart
elsif(/^C: (.*)/i) {
@ -187,6 +201,10 @@ sub single {
print STDERR "$f:$line:1:ERROR: no 'SPDX-License-Identifier:' field present\n";
return 2;
}
if(!$proto[0] && ($section == 3)) {
printf STDERR "$f:$line:1:ERROR: missing Protocol:\n";
exit 2;
}
last;
}
else {