diff options
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($_); |