Skip Menu |

This queue is for tickets about the Getopt-Euclid CPAN distribution.

Report information
The Basics
Id: 34207
Status: resolved
Priority: 0/
Queue: Getopt-Euclid

People
Owner: Nobody in particular
Requestors: djerius [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: v0.2.0
Fixed in: (no value)



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)
Should be fixed in 0.2.4. Thanks for reporting!