- ## --latest
- my $value = shift @collection;
- help( 1, 'Missing value for ' . $key ) unless defined $value;
- help( 1, 'Invalid value for ' . $key ) unless $value =~ /^\d+(?:\.\d+)*$/;
- $opt{latest} = $value;
- }
- elsif ( $key =~ /^--(tmpl|docroot)$/ ) {
-
- ## --tmpl and --docroot
- my $value = shift @collection;
- help( 1, 'Missing value for ' . $key ) unless defined $value;
- $value = File::Spec->rel2abs($value);
- help( 1, 'No such directory: ' . $value ) unless -d $value;
- $opt{$1} = $value;
- $opt{$1} =~ s#/+$##;
- }
- else {
- help( 1, 'Bad argument: ' . $key );
- }
+ ## --spec and --filter lists
+ foreach my $set (qw[spec filter]) {
+ $opt{$set} = [ map { my $f = File::Spec->rel2abs($_); help( 1, 'No such file: ' . $_ ) unless -f $f; $f } @{ $opt{$set} } ];