Subject: | /regex/ placeholder type doesn't accept all regexes correctly |
I'd like to use the following regex for a placeholder type:
=item -t <op>
The string used to prefix the output file name(s).
=for Euclid
op.type: /^(add|mul)$/
op.default: 'mul'
but the leading ^ seems to mess up the works. With only optional
arguments, "-t add" results in:
Invalid "-t <op>" argument
<op> must be /^(add|mul)$/ but the supplied value ("add") isn't.
If I add some required arguments, "-t add" results in:
Unknown argument: add
(Similar to bug #27074)
Removing the ^ makes it "work".
Sample code follows:
#!/usr/bin/perl
use strict;
use warnings;
use Getopt::Euclid qw( :minimal_keys );
__END__
=head1 REQUIRED ARGUMENTS
=over
=item <regfile>
The name of the region file upon which to operate.
=for Euclid
regfile.type: readable
=back
=head1 OPTIONS
=over
=item -t <op>
The string used to prefix the output file name(s).
=for Euclid
op.type: /^(add|mul)$/
op.default: 'mul'
=bac