Skip Menu |

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

Report information
The Basics
Id: 50157
Status: resolved
Priority: 0/
Queue: Getopt-Long

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

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



Subject: lowlevel documentation confusion wrt vararg-options
documentation bug (as I like the actual behaviour much more than my interpretation of the description): --list a b c -v can be parsed with Elisheva's example using Getop::Long and a vararg option of list=s@{,}. According to my reading of the 2.38 docs however, the --list option should have eaten -v as well, as it states that args can start with - or --. Which I'd take to mean that all further elements in @ARGV are eaten by --list. Please see for the example and the full thread: http://perlmonks.org/?node_id=798692. ==== Btw. the module doesn't allow a configuration to stop eating varargs and stop option processing when encountering an existing file? [looks like I have to ask the user to just enter -- for this case; still, I've seen enough that using this trick your module will allow me significant code cleanup over my current getopt use. Thus ->] A big thank you, Peter
Subject: Re: [rt.cpan.org #50157] lowlevel documentation confusion wrt vararg-options
Date: Fri, 2 Oct 2009 09:53:09 +0200
To: bug-Getopt-Long [...] rt.cpan.org
From: Johan Vromans <jvromans [...] squirrel.nl>
[Quoting Peter Jakobi via RT, on October 1 2009, 16:44, in "[rt.cpan.org #50157]"] Show quoted text
> According to my reading of the 2.38 docs however, the --list option > should have eaten -v as well, as it states that args can start with > - or --. Which I'd take to mean that all further elements in @ARGV > are eaten by --list.
Args can start with -/-- only if mandatory. list=s@{,} allows for many arguments, but does not require them. list=s@{,4} would *require* 4 arguments and eat -/-- args if necessary. Show quoted text
Thanks for letting me know. Show quoted text
> Btw. the module doesn't allow a configuration to stop eating varargs > and stop option processing when encountering an existing file?
My first reaction was: No, it doesn't play mp3 files either. But you might look in the docs for !FINISH ... Happy hacking! -- Johan