From: Dr. David von Oheimb Date: Sun, 16 May 2021 13:38:19 +0000 (+0200) Subject: find-doc-nits: Check that man1 SYNOPSIS and OPTIONS contain same options X-Git-Tag: openssl-3.0.0-beta1~468 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9c1582807b535e5b8499897c6e74fec48440c4fe;p=thirdparty%2Fopenssl.git find-doc-nits: Check that man1 SYNOPSIS and OPTIONS contain same options Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/15299) --- diff --git a/doc/man1/openssl.pod b/doc/man1/openssl.pod index 3b47ae97298..78b98ab7a6b 100644 --- a/doc/man1/openssl.pod +++ b/doc/man1/openssl.pod @@ -13,13 +13,13 @@ I B B -B | -B | -B | -B | -B | -B | -B +B<-standard-commands> | +B<-digest-commands> | +B<-cipher-commands> | +B<-cipher-algorithms> | +B<-digest-algorithms> | +B<-mac-algorithms> | +B<-public-key-algorithms> B BI [ I ] diff --git a/util/find-doc-nits b/util/find-doc-nits index 8a2776486d4..7d68f70c029 100755 --- a/util/find-doc-nits +++ b/util/find-doc-nits @@ -549,8 +549,10 @@ sub option_check { err($id, "Malformed option [1] in SYNOPSIS: $&"); } + my @synopsis; while ( $synopsis =~ /$markup_re/msg ) { my $found = $&; + push @synopsis, $found if $found =~ /^B<-/; print STDERR "$id:DEBUG[option_check] SYNOPSIS: found $found\n" if $debug; my $option_uw = normalise_option($id, $filename, $found); @@ -560,6 +562,7 @@ sub option_check { # In OPTIONS, we look for =item paragraphs. # (?=^\s*$) detects an empty line. + my @options; while ( $options =~ /=item\s+(.*?)(?=^\s*$)/msg ) { my $item = $&; @@ -573,8 +576,19 @@ sub option_check { my $option_uw = normalise_option($id, $filename, $found); err($id, "Malformed option in OPTIONS: $found") if defined $option_uw && $option_uw eq ''; + if ($found =~ /^B<-/) { + push @options, $found; + err($id, "OPTIONS entry $found missing from SYNOPSIS") + unless (grep /^\Q$found\E$/, @synopsis) + || $id =~ /(openssl|-options)\.pod:1:$/; + } } } + foreach (@synopsis) { + my $option = $_; + err($id, "SYNOPSIS entry $option missing from OPTIONS") + unless (grep /^\Q$option\E$/, @options); + } } # Normal symbol form