};
sub _run_cli_generate {
- my ($self, $to) = @_;
+ my ($self, $to, @spec) = @_;
die "generate requires a directory to generate to"
unless $to and -d $to;
my $out = io($to);
+ my $check = do {
+ if (@spec) { '^('.join('|',map quotemeta($_),@spec).')' }
+ else { '.' }
+ };
foreach my $path ('', $self->pages->all_paths) {
+ next unless "$path/" =~ /$check/;
+ print "Generating ${path}\n";
my $dir = $out->catdir($path);
$dir->mkpath;
$dir->catfile('index.html')->print(
);
}
foreach my $path (map "/feed/$_/", keys %{$self->_feed_configs}) {
+ next unless "$path/" =~ /$check/;
+ print "Generating ${path}\n";
my $dir = $out->catdir($path);
$dir->mkpath;
$dir->catfile('index.atom')->print(