Skip Menu |

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

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

People
Owner: jv [...] cpan.org
Requestors: rabbit [...] rabbit.us
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 2.37
Fixed in: 2.52



Subject: 'bundling' disables 'auto_abbrev' contrary to documentation
As per the documentation these two options should be getting along nicely: "... Note that, if you have options a, l and all, and auto_abbrev enabled, possible arguments and option settings are...". In fact bundling unconditionally disables auto_abbrev for single dash options. Here is the output produced by the attached test program: rabbit@Thesaurus:~$ ./getopt_tst -a -all --al --st -s 2.37 at ./getopt_tst line 8. want a at ./getopt_tst line 21. want a at ./getopt_tst line 21. want l at ./getopt_tst line 21. want l at ./getopt_tst line 21. want all at ./getopt_tst line 21. want stuff at ./getopt_tst line 21. Unknown option: s rabbit@Thesaurus:~$ rabbit@Thesaurus:~$ MULTIOPT=1 ./getopt_tst -a -all --al --st -s 2.37 at ./getopt_tst line 8. want a at ./getopt_tst line 21. want a at ./getopt_tst line 21. want l at ./getopt_tst line 21. want l at ./getopt_tst line 21. want all at ./getopt_tst line 21. want stuff at ./getopt_tst line 21. want stuff at ./getopt_tst line 21. rabbit@Thesaurus:~$ At the very least documentation should be fixed, although it would be nice if the feature would actually work :) Cheers Peter
Subject: getopt_tst
Download getopt_tst
application/octet-stream 378b

Message body not shown because it is not plain text.

I think I documented somewhere that using bundling with abbrev could lead to surprising results. Can you indicate what you mean with "the feature would actually work"?
From: rabbit [...] rabbit.us
On Mon Jun 09 05:24:56 2008, JV wrote: Show quoted text
> I think I documented somewhere that using bundling with abbrev could > lead to surprising results.
I combed the POD again, and the only thing I see about abbrev and bundling is the extended explanation of bundling at http://search.cpan.org/~jv/Getopt-Long-2.37/lib/Getopt/Long.pm#Configuring_Getopt::Long Show quoted text
> Can you indicate what you mean with "the feature would actually work"?
The two examples in the original bug report should be behaving identically (i.e. recognize that the lone -s is an abbreviation of --stuff)
I think this is not worth the effort.
On Sun Nov 20 09:42:28 2011, JV wrote: Show quoted text
> I think this is not worth the effort.
Fair enough - could you please adjust the pod documenting the inconsistency?
CC: undisclosed-recipients:;
Subject: Re: [rt.cpan.org #36380] 'bundling' disables 'auto_abbrev' contrary to documentation
Date: Tue, 22 Nov 2011 10:46:35 +0100
To: bug-Getopt-Long [...] rt.cpan.org
From: Johan Vromans <jvromans [...] squirrel.nl>
Show quoted text
> Fair enough - could you please adjust the pod documenting the inconsistency?
Patches welcome.
Subject: Re: [rt.cpan.org #36380] 'bundling' disables 'auto_abbrev' contrary to documentation
Date: Tue, 23 May 2017 18:37:03 -0400
To: bug-Getopt-Long [...] rt.cpan.org
From: "David H. Gutteridge" <dhgutteridge [...] sympatico.ca>
I also recently stumbled over this, and I see others have too (see the discussion in http://www.perlmonks.org/?node_id=484618). To be more explicit, I'd suggest this patch: --- ./Long.pm.orig 2016-06-09 08:50:37.000000000 -0400 +++ ./Long.pm 2017-05-23 18:28:19.312377550 -0400 @@ -2186,9 +2186,9 @@      Getopt::Long::Configure ("bundling");    Configured this way, single-character options can be bundled but long -options B<must> always start with a double dash C<--> to avoid -ambiguity. For example, when C<vax>, C<a>, C<v> and C<x> are all valid -options, +options (and any of their auto-abbreviated shortened forms) B<must> +always start with a double dash C<--> to avoid ambiguity. For example, +when C<vax>, C<a>, C<v> and C<x> are all valid options,        -vax   @@ -2377,7 +2377,8 @@    Enabling this option will allow single-character options to be  bundled. To distinguish bundles from long option names, long options -I<must> be introduced with C<--> and bundles with C<->. +(and any of their auto-abbreviated shortened forms) I<must> be +introduced with C<--> and bundles with C<->.    Note that, if you have options C<a>, C<l> and C<all>, and  auto_abbrev enabled, possible arguments and option settings are: Regards, Dave
Subject: Re: [rt.cpan.org #36380] 'bundling' disables 'auto_abbrev' contrary to documentation
Date: Wed, 24 May 2017 08:14:08 +0200
To: bug-Getopt-Long [...] rt.cpan.org
From: Johan Vromans <jvromans [...] squirrel.nl>
On Tue, 23 May 2017 18:37:16 -0400, "David H. Gutteridge via RT" <bug-Getopt-Long@rt.cpan.org> wrote: Show quoted text
> I also recently stumbled over this, and I see others have too (see > the discussion in http://www.perlmonks.org/?node_id=484618). To be > more explicit, I'd suggest this patch:
Can you make a PR on GitHub? Thanks.