mirror of
https://github.com/curl/curl.git
synced 2026-05-30 06:47:28 +03:00
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:
parent
98f67a6145
commit
b935fd4a07
498 changed files with 1117 additions and 2 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue