Subject: | .type.error ignored if additional placeholder constraint is evaluated |
If an additional placeholder constraint is placed on an option, and that
code is actually evaluated, then the .type.error specification is
ignored. For example (from the docs):
=item -size <h>
something useful
=for Euclid:
h.type: integer, h > 0 && h < 100
h.type.error: <h> must be between 0 and 100 (not h)
In this first example, the "integer" test fails, and type.error is used:
% perl ~/tmp/goe -size not_an_integer
Invalid "-size <h>" argument
<h> must be between 0 and 100 (not not_an_integer)
(Try: goe --help)
In this example, the "integer" test succeeds, but additional constraint
fails:
macabre% perl ~/tmp/goe -size 150
Invalid "-size <h>" argument.
<h> must be > 0 &&< 100 but the supplied value ("150") isn't.
(Try: goe --help)
Sample code follows:
#!/usr/bin/perl
use strict;
use warnings;
use Getopt::Euclid;
__END__
=head1 OPTIONS
=over
=item -size <h>
something useful
=for Euclid:
h.type: integer, h > 0 && h < 100
h.type.error: <h> must be between 0 and 100 (not h)