Bug#764621: Please add support for Getopt::Long bundling_values or similar

Dominic Hargreaves dom at earth.li
Thu Jan 1 17:25:36 UTC 2015


Control: tags -1 + upstream
Control: forwarded -1 bug-Getopt-Long at rt.cpan.org

Hi,

Please see this request from a Debian user to add support for an additional
bundling option to Getopt::Long.

Thanks!
Dominic.

----- Forwarded message from Guillem Jover <guillem at debian.org> -----

Date: Thu, 9 Oct 2014 18:31:33 +0200
From: Guillem Jover <guillem at debian.org>
To: submit at bugs.debian.org
Subject: Bug#764621: perl: Please add support for Getopt::Long bundling_values
	or similar

Package: perl
Version: 5.20.1-1
Severity: wishlist
Tags: upstream

Hi!

The dpkg-dev perl scripts have an inconsistent diversity of command-line
option and command formats. Some use Getopt::Long, many use ad-hoc
parsing. Some support long and short options, some only short, some
support all or a subset of the following:

 -o
 -o value
 -ovalue
 --option
 --option value
 --option=value
 --optionvalue (!, but I should just get rid of this one)

I'd like to eventually unify them all by using Getopt::Long. But to
support the above 6 (sane) variants for backward compatibility, I'd
have to enable bundling, which I think is not a very good idea, as it's
not future proof, because if users can bundle options then adding
support for values to an existing option breaks those invocations.

Bundling values (for short options) should always be safe, but there's
currently no way to only enable value bundling, which is what I'm missing.
I guess I'll have to write my own option parser or Getopt::Long wrapper,
due to only wanting to use modules and perl versions available from
oldstable, but it'd be nice to be able to eventually get rid of it.

I'd like to have a new bundling_values option, that given the following
option specifiers:

 o=s
 x
 y

would not allow any of:

 -xy -xovalue -xo value

only:

 -x -y -ovalue -o value

which are always safe and future proof.

Thanks,
Guillem


----- End forwarded message -----




More information about the Perl-maintainers mailing list