sub preprocess (@) { #{{{
my %params=@_;
+ foreach my $param (qw{match pagespec}) {
+ if (! exists $params{$param}) {
+ error sprintf(gettext("%s parameter is required"), $param);
+ }
+ }
+
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