Subject: | [RT #79982] Getopt-Long-Descriptive: Show whether an option requires an argument in usage |
Date: | Sun, 07 Apr 2013 11:51:25 +0200 |
To: | bug-Getopt-Long-Descriptive [...] rt.cpan.org |
From: | Niels Thykier <niels [...] thykier.net> |
Hi,
I have created a couple of patches to ticket #79982 that adds an
"argument" to the usage output when ":" or "=" is used in the option
spec. Note that "{N,M}" specifications are ignored, so it won't be
correct for those cases.
I have attached the 3 patches[1], a small prototype attempt to convert
Lintian's argument parsing to Getopt::Long::Descriptive and the usage
from that script with and without the attached patches applied.
Notice that 0003 also reduces the spacing between the arguments and
their description. Part of it is that it calculates the space exactly
instead of heurestically. Personally I consider this a feature because
it gives more room to descriptions[2], but feel free to adjust the
spacing. I am more interested in showing the argument.
~Niels
[1] If you are using a (public) VCS, it might be prudent to at least
merge 0002 and 0003 as 0002 breaks spacing rules, which is fixed by 0003.
[2] With the patched variant has 6 lines fewer than the "normal" one.
Message body is not shown because sender requested not to inline it.
Message body is not shown because sender requested not to inline it.
Message body is not shown because sender requested not to inline it.
Message body is not shown because sender requested not to inline it.
Message body is not shown because sender requested not to inline it.
Message body is not shown because sender requested not to inline it.