X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/f8a7fb227b59463b37180b1e525c5d19ec0e43cb..e5f1688ac39d9a3e0e63a8683105677af2dc4c1c:/IkiWiki/Plugin/testpagespec.pm?ds=sidebyside diff --git a/IkiWiki/Plugin/testpagespec.pm b/IkiWiki/Plugin/testpagespec.pm index 56dc03cef..f9ec90d87 100644 --- a/IkiWiki/Plugin/testpagespec.pm +++ b/IkiWiki/Plugin/testpagespec.pm @@ -12,12 +12,22 @@ sub import { #{{{ sub preprocess (@) { #{{{ my %params=@_; + foreach my $param (qw{match pagespec}) { + if (! exists $params{$param}) { + return "[[testpagespec $param parameter is required]]"; + } + } + add_depends($params{page}, $params{pagespec}); my $ret=pagespec_match($params{match}, $params{pagespec}, location => $params{page}); - return $ret if ! $ret; - return "the pagespec matches"; + if ($ret) { + return "match: $ret"; + } + else { + return "no match: $ret"; + } } # }}} 1