Subject: | Getopt::Euclid v0.0.4: Missleading error message |
Date: | Sun, 29 Jan 2006 21:12:06 +0100 |
To: | bug-getopt-euclid [...] rt.cpan.org |
From: | Philipp Grau <phgrau [...] ZEDAT.FU-Berlin.DE> |
Hello,
while reading Perl Best Practices I discoverd Getopt::Euclid. I had been
searching for something like this a long time. Thank you for this very nice
module.
While converting one of my small scripts I run in the following problem:
Working example:
----------8<--------snipp---------8<-------------------------
#!/usr/bin/perl -w
use Getopt::Euclid;
__END__
=head1 NAME
yourprog - Your program here
=head1 USAGE
myprog -c[opy] <file> <dest>
=head1 REQUIRED ARGUMENTS
=over
=item -c[opy] <file> <dest>
copy file
=for Euclid:
file.type: readable
dest.type: string
----------8<--------snipp---------8<-------------------------
What I see calling the script with only one argument (stupid me) to the
-copy option is this:
,----
| $ bin/mover.pl -copy mozilla.ps
| Invalid "-c[opy] <file> <dest>" argument.
| <file> must be readable but the supplied value ("mozilla.p") isn't.
| (Try: mover.pl --help)
|
| BEGIN failed--compilation aborted at bin/mover.pl line 4.
`----
Somehow the last char from mozilla.ps gets lost, even when mozilla.ps is
there.
When I try it with a nonexistent file, the last char is lost too:
,----
| $ bin/mover.pl -copy mozilla
| Invalid "-c[opy] <file> <dest>" argument.
| <file> must be readable but the supplied value ("mozill") isn't.
| (Try: mover.pl --help)
|
| BEGIN failed--compilation aborted at bin/mover.pl line 4.
`----
What I would expect is a correct file name in the last case, and in the
first case a complaint about the missing second argument.
Regrads,
Philipp Grau