diff options
author | Rich Salz <rsalz@openssl.org> | 2016-12-12 11:14:40 -0500 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2016-12-13 12:12:35 -0500 |
commit | 3dfda1a6363c0cf4efee94754a36c2d86be190c3 (patch) | |
tree | eb6ccd6b25de2244c3d01cf49bf683563cca1a4c /util | |
parent | b9b5181dd2f52ff0560a33b116396cdae5e48048 (diff) |
Fix various doc nits.
find-doc-nits warns if you don't give a "what to do flag"
Don't use regexps for section names, just strings: More consistency.
Rename "COMMAND OPTIONS" to OPTIONS.
Fix a couple of other nit-level things.
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2076)
Diffstat (limited to 'util')
-rwxr-xr-x | util/find-doc-nits.pl | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/util/find-doc-nits.pl b/util/find-doc-nits.pl index 8945fa6879..fc795b8789 100755 --- a/util/find-doc-nits.pl +++ b/util/find-doc-nits.pl @@ -41,8 +41,8 @@ my $OUT; my %mandatory_sections = ( '*' => [ 'NAME', 'DESCRIPTION', 'COPYRIGHT' ], - 1 => [ 'SYNOPSIS', '(COMMAND\s+)?OPTIONS' ], - 3 => [ 'SYNOPSIS', 'RETURN\s+VALUES' ], + 1 => [ 'SYNOPSIS', 'OPTIONS' ], + 3 => [ 'SYNOPSIS', 'RETURN VALUES' ], 5 => [ ], 7 => [ ] ); @@ -174,7 +174,7 @@ sub check() $section = $1 if $dirname =~ /man([1-9])/; foreach ((@{$mandatory_sections{'*'}}, @{$mandatory_sections{$section}})) { - print "$id doesn't have a head1 section matching $_\n" + print "$id: missing $_ head1 section\n" if $contents !~ /^=head1\s+${_}\s*$/m; } @@ -257,6 +257,9 @@ getopts('nshu'); &help() if ( $opt_h ); +die "Need one of -n -s or -u flags.\n" + unless $opt_n or $opt_s or $opt_u; + if ( $opt_n or $opt_s ) { foreach (@ARGV ? @ARGV : glob('doc/*/*.pod')) { &check($_); |