summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>2021-05-16 15:38:19 +0200
committerDr. David von Oheimb <dev@ddvo.net>2021-05-20 16:24:43 +0200
commit9c1582807b535e5b8499897c6e74fec48440c4fe (patch)
tree6aad3867911c8fa4e5af8e1fbc75491c7ed427ee /util
parent414823d2de6f370cf2102f3418780a428803a70f (diff)
find-doc-nits: Check that man1 SYNOPSIS and OPTIONS contain same options
Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15299)
Diffstat (limited to 'util')
-rwxr-xr-xutil/find-doc-nits14
1 files changed, 14 insertions, 0 deletions
diff --git a/util/find-doc-nits b/util/find-doc-nits
index 8a2776486d..7d68f70c02 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