Subject: | Getopt::Euclid bug: it chokes when one option value is a substring of another option value |
Date: | Fri, 20 Apr 2012 20:01:58 +0400 |
To: | bug-getopt-euclid [...] rt.cpan.org |
From: | Igor Kleshchevich <inky [...] inera.com> |
Hello dear Getopt::Euclid hackers! :-)
I've encountered what appears to be a serious bug in Getopt::Euclid.
(It's possible that I'm doing something wrong, of course, but if so,
I cannot determine what it is)
It seems that when Getopt::Euclid is used to define CL interface for
a Pelr script, and when of two consecutive parameters passed to
that script first is a substring of a second, Getopt::Euclid chokes on
it.
*****************************************************
One example is the attached file Test.pl.
It has the following in its POD section:
=item -compare <old_dir> <new_dir>
Specify a pair of directory paths to compare:
=for Euclid:
old_dir.type: string
new_dir.type: string
If this script is called like this:
Perl Test.pl -compare AAA BBBB
or like this:
Perl Test.pl -compare AAA AA
it works just fine.
However, if the first value is a substring of the second value,
it chocks:
Perl Test.pl -compare AAA AAAA
Unknown argument: AAAA
(Try this for usage help : Test.pl --help)
(Try this for full manual: Test.pl --man )
*****************************************************
2. Another example is the attached file Test1.pl
It has the following in its POD section:
=item -old <old>
Specify old string
=for Euclid:
old.type: string
=item -new <new>
Specify new string
=for Euclid:
new.type: string
Again, if I run
Perl Test1.pl -old AAA -new BB
or
Perl Test1.pl -old AAA -new AA
it works just fine.
But if I run
Perl Test1.pl -old AAA -new AAAA
it chocks with a somewhat different message:
Unknown argument: -new AAAA
(Try this for usage help : Test1.pl --help)
(Try this for full manual: Test1.pl --man )
*****************************************************
I'm running ActiveState distribution of Perl 5.10 on Windows XP.
Getopt::Euclid version 0.3.5
If it would help I can easily test on Perl 5.12 and 5.14,
and on Windows 7.
I hope this is relevant, and will help to improve great Getopt::Euclid module!
Please let me know if I can help further.
Of course I would like to know what happens to this bug.
Thank you!
Igor
Below are details about my Perl installation in case they may be relevant:
******************************************************
Here is the output of "Perl --version":
This is perl, v5.10.1 built for MSWin32-x86-multi-thread
(with 2 registered patches, see perl -V for more detail)
Copyright 1987-2009, Larry Wall
Binary build 1006 [291086] provided by ActiveState http://www.ActiveState.com
Built Aug 24 2009 13:48:26
Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.
******************************************************
Here is the output of "Perl -V":
Summary of my perl5 (revision 5 version 10 subversion 1) configuration:
Platform:
osname=MSWin32, osvers=5.00, archname=MSWin32-x86-multi-thread
uname=''
config_args='undef'
hint=recommended, useposix=true, d_sigaction=undef
useithreads=define, usemultiplicity=define
useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
use64bitint=undef, use64bitall=undef, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cl', ccflags ='-nologo -GF -W3 -MD -Zi -DNDEBUG -O1 -DWIN32 -D_CONSOLE -
DNO_STRICT -DHAVE_DES_FCRYPT -DUSE_SITECUSTOMIZE -DPRIVLIB_LAST_IN_INC -DPERL_IM
PLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX',
optimize='-MD -Zi -DNDEBUG -O1',
cppflags='-DWIN32'
ccversion='12.00.8804', gccversion='', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=8
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='__int64', lseeksi
ze=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='link', ldflags ='-nologo -nodefaultlib -debug -opt:ref,icf -libpath:"C:
\Perl\lib\CORE" -machine:x86'
libpth=\lib
libs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32
.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib ws2_
32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib msvcrt.lib
perllibs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comd
lg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib
ws2_32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib msvcrt.lib
libc=msvcrt.lib, so=dll, useshrplib=true, libperl=perl510.lib
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -debug -opt:ref,icf -
libpath:"C:\Perl\lib\CORE" -machine:x86'
Characteristics of this binary (from libperl):
Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GVSV
PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS
PERL_MALLOC_WRAP PL_OP_SLAB_ALLOC USE_ITHREADS
USE_LARGE_FILES USE_PERLIO USE_SITECUSTOMIZE
Locally applied patches:
ActivePerl Build 1006 [291086]
32728 64-bit fix for Time::Local
Built under MSWin32
Compiled at Aug 24 2009 13:48:26
@INC:
C:/Perl/site/lib
C:/Perl/lib
.
Message body is not shown because sender requested not to inline it.
Message body is not shown because sender requested not to inline it.