Skip Menu |

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

Report information
The Basics
Id: 17345
Status: stalled
Priority: 0/
Queue: Getopt-Euclid

People
Owner: Nobody in particular
Requestors: phgrau [...] ZEDAT.FU-Berlin.DE
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



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
I can confirm this is still a bug in 0.2.0: use Getopt::Euclid; use YAML::Syck; print Dump \%ARGV; =head1 REQUIRED ARGUMENTS =over =item -c[opy] <file> <dest> =for Euclid: file.type: readable dest.type: string =back =cut perl foo.pl -c foo.pll --- -c: &1 dest: l file: foo.pl -copy: *1 I will be deferring this until I redo the argument parser.