Skip to content

Commit 9f6657a

Browse files
committed
display error message if no POD found
1 parent ef6516f commit 9f6657a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

bin/p6doc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ sub locate-module(Str $modulename) {
4646

4747
sub show-docs(Str $path, :$section) {
4848
my $pager = %*ENV<PAGER> // ($*OS eq 'MSWin32' ?? 'more' !! 'less');
49+
if not open($path).lines.grep( /^\=/ ) {
50+
say "No POD found in $path";
51+
return;
52+
}
4953
if $section.defined {
5054
%*ENV<PERL6_POD_HEADING> = $section;
5155
my $i = findbin() ~ '../lib';

0 commit comments

Comments
 (0)