Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

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

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

People
Owner: Nobody in particular
Requestors: tomas.zemres [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.090
Fixed in: (no value)



Subject: why is stripped out "\n" from $usage_desc?
why is "\n" stripped out from $usage_desc? because I cannot simple put string with description like: "%c %o\n\n This script returns number of users\n" To generate usage message: myscript.pl [-h] This script returns number of users Options: -h --help Show usage message -- Is there any simple way to put "description" into usage (without overriding classes etc.) Tomas
On Thu Jul 14 03:31:37 2011, https://www.google.com/accounts/o8/id?id=AItOawnPete96S9pvWuJtbNOb8B9q_xx8AxoCno wrote: Show quoted text
> why is "\n" stripped out from $usage_desc?
Looks like the culprit is line 160 of lib/Getopt/Long/Descriptive.pm: 159 (my $str = $format) =~ s/%(.)/$replace{$1}/ge; 160 $str =~ s/\s{2,}/ /g; \s{2,} will apparently match newlines as well as spaces. I'm sure that this regular expression can be tweaked a bit so that consecutive spaces are consolidated into one, but newlines are preserved.
should be resolved in tonight's release, but I didn't test it -- rjbs