]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
opt-docs: verify man page sections + order
authorDaniel Stenberg <daniel@haxx.se>
Wed, 1 Sep 2021 08:26:36 +0000 (10:26 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 4 Sep 2021 09:27:46 +0000 (11:27 +0200)
In every libcurl option man page there are now 8 mandatory sections that
must use the right name in the correct order and test 1173 verifies
this. Only 14 man pages needed adjustments.

The sections and the order is as follows:

 - NAME
 - SYNOPSIS
 - DESCRIPTION
 - PROTOCOLS
 - EXAMPLE
 - AVAILABILITY
 - RETURN VALUE
 - SEE ALSO

Reviewed-by: Daniel Gustafsson
Closes #7656

16 files changed:
docs/libcurl/opts/CURLOPT_ABSTRACT_UNIX_SOCKET.3
docs/libcurl/opts/CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS.3
docs/libcurl/opts/CURLOPT_HAPROXYPROTOCOL.3
docs/libcurl/opts/CURLOPT_HEADER.3
docs/libcurl/opts/CURLOPT_MIMEPOST.3
docs/libcurl/opts/CURLOPT_NOSIGNAL.3
docs/libcurl/opts/CURLOPT_PROXY_SSL_OPTIONS.3
docs/libcurl/opts/CURLOPT_SSL_FALSESTART.3
docs/libcurl/opts/CURLOPT_TCP_FASTOPEN.3
docs/libcurl/opts/CURLOPT_TFTP_NO_OPTIONS.3
docs/libcurl/opts/CURLOPT_TRAILERDATA.3
docs/libcurl/opts/CURLOPT_TRAILERFUNCTION.3
docs/libcurl/opts/CURLOPT_UNIX_SOCKET_PATH.3
docs/libcurl/opts/CURLOPT_UPKEEP_INTERVAL_MS.3
docs/libcurl/opts/CURLOPT_WRITEFUNCTION.3
tests/manpage-syntax.pl

index 1373089552895cec2923a9f89d63ec208e665710..40c1dd235aaf0ef16151aa555629c5fe836984b0 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 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
@@ -28,26 +28,27 @@ CURLOPT_ABSTRACT_UNIX_SOCKET \- set an abstract Unix domain socket
 
 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_ABSTRACT_UNIX_SOCKET, char *path);
 .SH DESCRIPTION
-Enables the use of an abstract Unix domain socket instead of establishing a TCP
-connection to a host. The parameter should be a char * to a null-terminated string
-holding the path of the socket. The path will be set to \fIpath\fP prefixed by a
-NULL byte (this is the convention for abstract sockets, however it should be stressed
-that the path passed to this function should not contain a leading NULL).
+Enables the use of an abstract Unix domain socket instead of establishing a
+TCP connection to a host. The parameter should be a char * to a
+null-terminated string holding the path of the socket. The path will be set to
+\fIpath\fP prefixed by a NULL byte (this is the convention for abstract
+sockets, however it should be stressed that the path passed to this function
+should not contain a leading NULL).
 
-On non-supporting platforms, the abstract address will be interpreted as an empty
-string and fail gracefully, generating a run-time error.
-
-This option shares the same semantics as
-.BR CURLOPT_UNIX_SOCKET_PATH "(3)
-in which documentation more details can be found. Internally, these two options share
-the same storage and therefore only one of them can be set per handle.
+On non-supporting platforms, the abstract address will be interpreted as an
+empty string and fail gracefully, generating a run-time error.
 
+This option shares the same semantics as \fICURLOPT_UNIX_SOCKET_PATH(3)\fP in
+which documentation more details can be found. Internally, these two options
+share the same storage and therefore only one of them can be set per handle.
 .SH DEFAULT
 Default is NULL.
+.SH PROTOCOLS
+All
 .SH EXAMPLE
 .nf
-    curl_easy_setopt(curl_handle, CURLOPT_ABSTRACT_UNIX_SOCKET, "/tmp/foo.sock");
-    curl_easy_setopt(curl_handle, CURLOPT_URL, "http://localhost/");
+  curl_easy_setopt(curl_handle, CURLOPT_ABSTRACT_UNIX_SOCKET, "/tmp/foo.sock");
+  curl_easy_setopt(curl_handle, CURLOPT_URL, "http://localhost/");
 .fi
 
 .SH AVAILABILITY
index 3058aad741a7dfb1089d51b2ee6ace21daf2d0ef..156a29bccb8bf381e47db82c4e59760fd129581d 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 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
@@ -40,6 +40,8 @@ Eyeballs RFC 6555 says "It is RECOMMENDED that connection attempts be paced
 currently defaults to 200 ms. Firefox and Chrome currently default to 300 ms.
 .SH DEFAULT
 CURL_HET_DEFAULT (currently defined as 200L)
+.SH PROTOCOLS
+All except FILE
 .SH EXAMPLE
 .nf
 CURL *curl = curl_easy_init();
@@ -57,3 +59,6 @@ if(curl) {
 Added in 7.59.0
 .SH RETURN VALUE
 Returns CURLE_OK
+.SH SEE ALSO
+.BR CURLOPT_CONNECTTIMEOUT_MS "(3), "
+.BR CURLOPT_TIMEOUT "(3), " CURLOPT_LOW_SPEED_LIMIT "(3), "
index 6a6a98eca2ac7488b4f191f01aea37dcd3c97cbe..d63e14aedecbd7b4f05bb96320a21ad06e4fade8 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 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
@@ -55,3 +55,5 @@ if(curl) {
 Along with HTTP. Added in 7.60.0.
 .SH RETURN VALUE
 Returns CURLE_OK if HTTP is enabled, and CURLE_UNKNOWN_OPTION if not.
+.SH SEE ALSO
+.BR CURLOPT_PROXY "(3), "
index 2cf080b585792743fabaef5b2758288e63a42aa4..4b5d14cb89ac5da6ddf0d0b4de8bb4894925e7a3 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 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
@@ -62,6 +62,8 @@ if(curl) {
   curl_easy_perform(curl);
 }
 .fi
+.SH AVAILABILITY
+Provided in all libcurl versions.
 .SH RETURN VALUE
 Returns CURLE_OK.
 .SH "SEE ALSO"
index 946d84b07d3691f51ecc6d167df343f246bd6eea..42fc6bbf4f0f72f75c39dd2a579572dd410c713c 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 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
@@ -40,13 +40,13 @@ This option is the preferred way of posting an HTTP form, replacing and
 extending the deprecated \fICURLOPT_HTTPPOST(3)\fP option.
 .SH PROTOCOLS
 HTTP, SMTP, IMAP.
-.SH AVAILABILITY
-Since 7.56.0.
-.SH RETURN VALUE
-This will return CURLE_OK.
 .SH EXAMPLE
 Using this option implies the use of several mime structure building
 functions: see https://curl.se/libcurl/c/smtp-mime.html for a complete
 example.
+.SH AVAILABILITY
+Since 7.56.0.
+.SH RETURN VALUE
+This will return CURLE_OK.
 .SH "SEE ALSO"
 .BR curl_mime_init "(3)"
index 3ee715ea10a81cc1401b774b6ab7da532245756b..3ca15244a8fd62d899d71657f3ace997217e45e0 100644 (file)
@@ -49,6 +49,8 @@ cases when they may still happen, contrary to our desire. In addition, using
 raised.
 .SH DEFAULT
 0
+.SH PROTOCOLS
+All
 .SH EXAMPLE
 .nf
 CURL *curl = curl_easy_init();
@@ -66,3 +68,5 @@ if(curl) {
 Added in 7.10
 .SH RETURN VALUE
 Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
+.SH SEE ALSO
+.BR CURLOPT_TIMEOUT "(3), "
index e5963dc4dcc1098e496118c2e1d42d6792e1c3c0..f16177337c57c8617bf7184037f9c900e80f7b98 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 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
@@ -67,8 +67,6 @@ could be a privacy violation and unexpected.
 0
 .SH PROTOCOLS
 All TLS-based protocols
-.SH AVAILABLE
-Added in 7.52.0
 .SH EXAMPLE
 .nf
 CURL *curl = curl_easy_init();
@@ -82,6 +80,8 @@ if(curl) {
   curl_easy_cleanup(curl);
 }
 .fi
+.SH AVAILABILITY
+Added in 7.52.0
 .SH RETURN VALUE
 Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
 .SH "SEE ALSO"
index 455a4b9f32ed2ea91242440665c688e155fd2a42..13df900c7c52150032281edc1decadfd2b732d34 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 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
@@ -53,3 +53,5 @@ Secure Transport (on iOS 7.0 or later, or OS X 10.9 or later) TLS backends.
 .SH RETURN VALUE
 Returns CURLE_OK if false start is supported by the SSL backend, otherwise
 returns CURLE_NOT_BUILT_IN.
+.SH SEE ALSO
+.BR CURLOPT_TCP_FASTOPEN "(3), "
index a9ad14fce8ed8c0fde0da21ea178f6ac0e781429..90c823fe6ae91696f6f1eb05a1c55152ac9f33ad 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 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
@@ -52,3 +52,5 @@ El Capitan.
 .SH RETURN VALUE
 Returns CURLE_OK if fast open is supported by the operating system, otherwise
 returns CURLE_NOT_BUILT_IN.
+.SH SEE ALSO
+.BR CURLOPT_SSL_FALSESTART "(3), "
index 8bfaa991490b5d3db76b77ae4cd8dc988ca10dd0..86f8d571ce87ca346bb4799688407f27969ab0f4 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 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
@@ -69,3 +69,5 @@ if(curl) {
 Added in 7.48.0
 .SH RETURN VALUE
 Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
+.SH SEE ALSO
+.BR CURLOPT_TFTP_BLKSIZE "(3), "
index 11c31ac7f7a35adc963db8a9cb5f9f70babd5c2e..9b7354fc575c0dfe057d6f9fbdc6f7bee8beb826 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 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
@@ -27,7 +27,7 @@ CURLOPT_TRAILERDATA \- Custom pointer passed to the trailing headers callback
 #include <curl.h>
 
 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TRAILERDATA, void *userdata);
-.SH DESCRIPTION:
+.SH DESCRIPTION
 Data pointer to be passed to the HTTP trailer callback function.
 .SH DEFAULT
 NULL
@@ -45,5 +45,7 @@ curl_easy_setopt(hndl, CURLOPT_TRAILERDATA, &data);
 A more complete example can be found in examples/http_trailers.html
 .SH AVAILABILITY
 This option was added in curl 7.64.0 and is present if HTTP support is enabled
+.SH RETURN VALUE
+Returns CURLE_OK.
 .SH "SEE ALSO"
 .BR CURLOPT_TRAILERFUNCTION "(3), "
index ae2e371780325aadf9034374e9f9b670a6317531..903e280923e4302c784d09a7e9b8650973adc5d7 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 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
@@ -97,5 +97,7 @@ if(curl) {
 }
 .SH AVAILABILITY
 This option was added in curl 7.64.0 and is present if HTTP support is enabled
+.SH RETURN VALUE
+Returns CURLE_OK.
 .SH "SEE ALSO"
 .BR CURLOPT_TRAILERDATA "(3), "
index b335fa8883aafa0e302469fa8a77a0fa950bffe3..bb6b521ab09af5c2a2c09f657485e87420b57a0c 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 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
@@ -40,12 +40,10 @@ curl does not need to resolve the DNS hostname in the URL.
 The maximum path length on Cygwin, Linux and Solaris is 107. On other platforms
 it might be even less.
 
-Proxy and TCP options such as
-.BR CURLOPT_TCP_NODELAY "(3)
-are not supported. Proxy options such as
-.BR CURLOPT_PROXY "(3)
-have no effect either as these are TCP-oriented, and asking a proxy server to
-connect to a certain Unix domain socket is not possible.
+Proxy and TCP options such as \fICURLOPT_TCP_NODELAY(3)\fP are not
+supported. Proxy options such as \fICURLOPT_PROXY(3)\fP have no effect either
+as these are TCP-oriented, and asking a proxy server to connect to a certain
+Unix domain socket is not possible.
 
 The application does not have to keep the string around after setting this
 option.
@@ -59,19 +57,19 @@ Given that you have an nginx server running, listening on /tmp/nginx.sock, you
 can request an HTTP resource with:
 
 .nf
-    curl_easy_setopt(curl_handle, CURLOPT_UNIX_SOCKET_PATH, "/tmp/nginx.sock");
-    curl_easy_setopt(curl_handle, CURLOPT_URL, "http://localhost/");
+  curl_easy_setopt(curl_handle, CURLOPT_UNIX_SOCKET_PATH, "/tmp/nginx.sock");
+  curl_easy_setopt(curl_handle, CURLOPT_URL, "http://localhost/");
 .fi
 
-If you are on Linux and somehow have a need for paths larger than 107 bytes, you
-could use the proc filesystem to bypass the limitation:
+If you are on Linux and somehow have a need for paths larger than 107 bytes,
+you could use the proc filesystem to bypass the limitation:
 
 .nf
-    int dirfd = open(long_directory_path_to_socket, O_DIRECTORY | O_RDONLY);
-    char path[108];
-    snprintf(path, sizeof(path), "/proc/self/fd/%d/nginx.sock", dirfd);
-    curl_easy_setopt(curl_handle, CURLOPT_UNIX_SOCKET_PATH, path);
-    /* Be sure to keep dirfd valid until you discard the handle */
+  int dirfd = open(long_directory_path_to_socket, O_DIRECTORY | O_RDONLY);
+  char path[108];
+  snprintf(path, sizeof(path), "/proc/self/fd/%d/nginx.sock", dirfd);
+  curl_easy_setopt(curl_handle, CURLOPT_UNIX_SOCKET_PATH, path);
+  /* Be sure to keep dirfd valid until you discard the handle */
 .fi
 .SH AVAILABILITY
 Since 7.40.0.
index c736329834a8b932f28ea54120774613e3c80640..ca4b114032b75c6f4587916f66b859202f2e5574 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 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
@@ -42,6 +42,8 @@ is called, an HTTP/2 PING frame is sent on the connection.
 
 .SH DEFAULT
 CURL_UPKEEP_INTERVAL_DEFAULT (currently defined as 60000L, which is 60 seconds)
+.SH PROTOCOLS
+All
 .SH EXAMPLE
 .nf
 CURL *curl = curl_easy_init();
@@ -71,3 +73,6 @@ if(curl) {
 Added in 7.62.0
 .SH RETURN VALUE
 Returns CURLE_OK
+.SH SEE ALSO
+.BR CURLOPT_TCP_KEEPALIVE "(3), "
+
index 672160b54fe9639b175fd10eb372db80a71e58eb..4814d691764e5b3a823b894e7e13a49471b7daae 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 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
@@ -74,10 +74,6 @@ do that.
 libcurl will use 'fwrite' as a callback by default.
 .SH PROTOCOLS
 For all protocols
-.SH AVAILABILITY
-Support for the CURL_WRITEFUNC_PAUSE return code was added in version 7.18.0.
-.SH RETURN VALUE
-This will return CURLE_OK.
 .SH EXAMPLE
 .nf
  struct memory {
@@ -110,6 +106,10 @@ This will return CURLE_OK.
  /* we pass our 'chunk' struct to the callback function */
  curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, (void *)&chunk);
 .fi
+.SH AVAILABILITY
+Support for the CURL_WRITEFUNC_PAUSE return code was added in version 7.18.0.
+.SH RETURN VALUE
+This will return CURLE_OK.
 .SH "SEE ALSO"
 .BR CURLOPT_WRITEDATA "(3), " CURLOPT_READFUNCTION "(3), "
 .BR CURLOPT_HEADERFUNCTION "(3), "
index 5a3bcec0dca5ecc9fdf834cdb338ceccf94f1041..1609ba220f4b491d13669e8e9ddb5c5d86161b16 100644 (file)
@@ -32,11 +32,27 @@ use warnings;
 my @manpages=@ARGV;
 my $errors = 0;
 
+my %blessed;
+my @order = (
+    'NAME',
+    'SYNOPSIS',
+    'DESCRIPTION',
+     #'DEFAULT', # CURLINFO_ has no default
+    'PROTOCOLS',
+    'EXAMPLE',
+    'AVAILABILITY',
+    'RETURN VALUE',
+    'SEE ALSO'
+    );
+my %shline; # section => line number
+
 sub scanmanpage {
     my ($file) = @_;
     my $reqex = 0;
     my $inex = 0;
     my $exsize = 0;
+    my $shc = 0;
+    my @sh;
 
     print "Check $file\n";
     open(M, "<$file") || die "no such file: $file";
@@ -46,15 +62,22 @@ sub scanmanpage {
     }
     my $line = 1;
     while(<M>) {
-        if($_ =~ /^.SH EXAMPLE/) {
+        if($_ =~ /^.SH EXAMPLE/i) {
             $inex = 1;
         }
-        elsif($_ =~ /^.SH/) {
+        elsif($_ =~ /^.SH/i) {
             $inex = 0;
         }
         elsif($inex)  {
             $exsize++;
         }
+        if($_ =~ /^.SH (.*)/i) {
+            my $n = $1;
+            # remove enclosing quotes
+            $n =~ s/\"(.*)\"\z/$1/;
+            push @sh, $n;
+            $shline{$n} = $line;
+        }
 
         if($_ =~ /^\'/) {
             print STDERR "$file:$line line starts with single quote!\n";
@@ -75,12 +98,52 @@ sub scanmanpage {
     }
     close(M);
 
-    if($reqex && ($exsize < 2)) {
-        print STDERR "$file:$line missing EXAMPLE section\n";
-        $errors++;
+    if($reqex) {
+        # only for libcurl options man-pages
+
+        if($exsize < 2) {
+            print STDERR "$file:$line missing EXAMPLE section\n";
+            $errors++;
+        }
+
+        my $got;
+        my $i = 0;
+        my $shused = 1;
+        do {
+            $got = shift(@sh);
+            if($got) {
+                $i = $blessed{$got};
+            }
+            if($i && $got) {
+                # mandatory section
+
+                if($i != $shused) {
+                    printf STDERR "$file:%u Got $got, when %s was expected\n",
+                        $shline{$got},
+                        $order[$shused-1];
+                    $errors++;
+                    return;
+                }
+                $shused++;
+                if($i == 9) {
+                    # last mandatory one, exit
+                    $got="";
+                }
+            }
+        } while($got);
+
+        if($i != 8) {
+            printf STDERR "$file:$line missing mandatory section: %s\n",
+                $order[$i];
+            $errors++;
+        }
     }
 }
 
+my $ind = 1;
+for my $s (@order) {
+    $blessed{$s} = $ind++
+}
 
 for my $m (@manpages) {
     scanmanpage($m);