summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2021-11-26 14:20:18 +0100
committerDaniel Stenberg <daniel@haxx.se>2021-11-26 16:51:23 +0100
commit230bb3e278877a8e99179f4df1893ee408d7baf5 (patch)
treebc907b31ad3430510ce0b414d40b8ae2e99a1bff /tests
parentff1c172e865640412aa081c6cf6112988e537c59 (diff)
downloadcurl-230bb3e278877a8e99179f4df1893ee408d7baf5.tar.gz
docs: consistent manpage SYNOPSIS
Make all libcurl related options use .nf (no fill) for the SYNOPSIS section - for consistent look. roffit then renders that section using <pre> (monospace font) in html for the website. Extended manpage-syntax (test 1173) with a basic check for it. Closes #8062
Diffstat (limited to 'tests')
-rw-r--r--tests/manpage-syntax.pl19
1 files changed, 17 insertions, 2 deletions
diff --git a/tests/manpage-syntax.pl b/tests/manpage-syntax.pl
index 67a0b7402..22d93e5d1 100644
--- a/tests/manpage-syntax.pl
+++ b/tests/manpage-syntax.pl
@@ -75,14 +75,16 @@ sub scanmanpage {
my ($file) = @_;
my $reqex = 0;
my $inex = 0;
+ my $insynop = 0;
my $exsize = 0;
+ my $synopsize = 0;
my $shc = 0;
my $optpage = 0; # option or function
my @sh;
open(M, "<$file") || die "no such file: $file";
if($file =~ /[\/\\](CURL|curl_)[^\/\\]*.3/) {
- # This is the man page for an libcurl option. It requires an example!
+ # This is a man page for libcurl. It requires an example!
$reqex = 1;
if($1 eq "CURL") {
$optpage = 1;
@@ -96,10 +98,17 @@ sub scanmanpage {
close(M);
return;
}
- if($_ =~ /^\.SH EXAMPLE/i) {
+ if(($_ =~ /^\.SH SYNOPSIS/i) && ($reqex)) {
+ # this is for libcurl man page SYNOPSIS checks
+ $insynop = 1;
+ $inex = 0;
+ }
+ elsif($_ =~ /^\.SH EXAMPLE/i) {
+ $insynop = 0;
$inex = 1;
}
elsif($_ =~ /^\.SH/i) {
+ $insynop = 0;
$inex = 0;
}
elsif($inex) {
@@ -108,6 +117,12 @@ sub scanmanpage {
print STDERR "$file:$line '\\n' need to be '\\\\n'!\n";
}
}
+ elsif($insynop) {
+ $synopsize++;
+ if(($synopsize == 1) && ($_ !~ /\.nf/)) {
+ print STDERR "$file:$line:1:ERROR: be .nf for proper formatting\n";
+ }
+ }
if($_ =~ /^\.SH ([^\r\n]*)/i) {
my $n = $1;
# remove enclosing quotes