diff options
author | Karl Williamson <khw@cpan.org> | 2020-08-26 16:07:42 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2020-09-04 16:13:25 -0600 |
commit | 36ea2d2f8cd0c6ceb2355bf9515ad1898d12ebfc (patch) | |
tree | 2ed057805f4512cd4487064c56c0d34f659f11af /autodoc.pl | |
parent | 783469ebcad3a69964c8d5388778410a94148593 (diff) | |
download | perl-36ea2d2f8cd0c6ceb2355bf9515ad1898d12ebfc.tar.gz |
autodoc: Don't output empty section
But warn when one encountered.
Diffstat (limited to 'autodoc.pl')
-rw-r--r-- | autodoc.pl | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/autodoc.pl b/autodoc.pl index bc34cbd154..9457f28fe8 100644 --- a/autodoc.pl +++ b/autodoc.pl @@ -1139,7 +1139,13 @@ sub output { for my $section_name (sort sort_helper keys %$dochash) { my $section_info = $dochash->{$section_name}; - next unless keys %$section_info; # Skip empty + + if (! %$section_info) { + warn "Empty section '$section_name'; skipped"; + delete $valid_sections{$section_name}; + next; + } + print $fh "\n=head1 $section_name\n"; print $fh "\n", $valid_sections{$section_name}{header}, "\n" |