r65434 - in /trunk/libgetopt-long-descriptive-perl: Changes META.yml README debian/changelog lib/Getopt/Long/Descriptive.pm lib/Getopt/Long/Descriptive/Opts.pm lib/Getopt/Long/Descriptive/Usage.pm t/descriptive.t
carnil at users.alioth.debian.org
carnil at users.alioth.debian.org
Wed Dec 1 08:42:53 UTC 2010
Author: carnil
Date: Wed Dec 1 08:42:39 2010
New Revision: 65434
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=65434
Log:
New upstream release
Modified:
trunk/libgetopt-long-descriptive-perl/Changes
trunk/libgetopt-long-descriptive-perl/META.yml
trunk/libgetopt-long-descriptive-perl/README
trunk/libgetopt-long-descriptive-perl/debian/changelog
trunk/libgetopt-long-descriptive-perl/lib/Getopt/Long/Descriptive.pm
trunk/libgetopt-long-descriptive-perl/lib/Getopt/Long/Descriptive/Opts.pm
trunk/libgetopt-long-descriptive-perl/lib/Getopt/Long/Descriptive/Usage.pm
trunk/libgetopt-long-descriptive-perl/t/descriptive.t
Modified: trunk/libgetopt-long-descriptive-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libgetopt-long-descriptive-perl/Changes?rev=65434&op=diff
==============================================================================
--- trunk/libgetopt-long-descriptive-perl/Changes (original)
+++ trunk/libgetopt-long-descriptive-perl/Changes Wed Dec 1 08:42:39 2010
@@ -1,4 +1,8 @@
Revision history for Getopt-Long-Descriptive
+
+0.087 2010-11-30
+ long option documentation strings are now line-wrapped and aligned
+ correctly (Dave Rolsky)
0.086 2010-09-19
fix minimum required version of Sub::Exporter
Modified: trunk/libgetopt-long-descriptive-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libgetopt-long-descriptive-perl/META.yml?rev=65434&op=diff
==============================================================================
--- trunk/libgetopt-long-descriptive-perl/META.yml (original)
+++ trunk/libgetopt-long-descriptive-perl/META.yml Wed Dec 1 08:42:39 2010
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: Getopt-Long-Descriptive
-version: 0.086
+version: 0.087
abstract: Getopt::Long, but simpler and more powerful
author:
- Hans Dieter Pearcey <hdp at cpan.org>
Modified: trunk/libgetopt-long-descriptive-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libgetopt-long-descriptive-perl/README?rev=65434&op=diff
==============================================================================
--- trunk/libgetopt-long-descriptive-perl/README (original)
+++ trunk/libgetopt-long-descriptive-perl/README Wed Dec 1 08:42:39 2010
@@ -2,7 +2,7 @@
VERSION
-0.086
+0.087
INSTALLATION
Modified: trunk/libgetopt-long-descriptive-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libgetopt-long-descriptive-perl/debian/changelog?rev=65434&op=diff
==============================================================================
--- trunk/libgetopt-long-descriptive-perl/debian/changelog (original)
+++ trunk/libgetopt-long-descriptive-perl/debian/changelog Wed Dec 1 08:42:39 2010
@@ -1,5 +1,6 @@
-libgetopt-long-descriptive-perl (0.086-2) UNRELEASED; urgency=low
+libgetopt-long-descriptive-perl (0.087-1) UNRELEASED; urgency=low
+ * New upstream release
* Update my email address.
-- Salvatore Bonaccorso <carnil at debian.org> Sun, 10 Oct 2010 15:03:00 +0200
Modified: trunk/libgetopt-long-descriptive-perl/lib/Getopt/Long/Descriptive.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libgetopt-long-descriptive-perl/lib/Getopt/Long/Descriptive.pm?rev=65434&op=diff
==============================================================================
--- trunk/libgetopt-long-descriptive-perl/lib/Getopt/Long/Descriptive.pm (original)
+++ trunk/libgetopt-long-descriptive-perl/lib/Getopt/Long/Descriptive.pm Wed Dec 1 08:42:39 2010
@@ -18,11 +18,11 @@
=head1 VERSION
-Version 0.086
+Version 0.087
=cut
-our $VERSION = '0.086';
+our $VERSION = '0.087';
=head1 SYNOPSIS
Modified: trunk/libgetopt-long-descriptive-perl/lib/Getopt/Long/Descriptive/Opts.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libgetopt-long-descriptive-perl/lib/Getopt/Long/Descriptive/Opts.pm?rev=65434&op=diff
==============================================================================
--- trunk/libgetopt-long-descriptive-perl/lib/Getopt/Long/Descriptive/Opts.pm (original)
+++ trunk/libgetopt-long-descriptive-perl/lib/Getopt/Long/Descriptive/Opts.pm Wed Dec 1 08:42:39 2010
@@ -10,11 +10,11 @@
=head1 VERSION
-Version 0.086
+Version 0.087
=cut
-our $VERSION = '0.086';
+our $VERSION = '0.087';
=head1 DESCRIPTION
Modified: trunk/libgetopt-long-descriptive-perl/lib/Getopt/Long/Descriptive/Usage.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libgetopt-long-descriptive-perl/lib/Getopt/Long/Descriptive/Usage.pm?rev=65434&op=diff
==============================================================================
--- trunk/libgetopt-long-descriptive-perl/lib/Getopt/Long/Descriptive/Usage.pm (original)
+++ trunk/libgetopt-long-descriptive-perl/lib/Getopt/Long/Descriptive/Usage.pm Wed Dec 1 08:42:39 2010
@@ -2,7 +2,7 @@
use strict;
use warnings;
-our $VERSION = '0.086';
+our $VERSION = '0.087';
use List::Util qw(max);
@@ -100,10 +100,37 @@
$spec = Getopt::Long::Descriptive->_strip_assignment($spec);
$spec = join " ", reverse map { length > 1 ? "--$_" : "-$_" }
split /\|/, $spec;
- $string .= sprintf "$spec_fmt %s\n", $spec, $desc;
+
+ my @desc = $self->_split_description($length, $desc);
+
+ $string .= sprintf "$spec_fmt %s\n", $spec, shift @desc;
+ for my $line (@desc) {
+ $string .= "\t";
+ $string .= q{ } x ( $length + 2 );
+ $string .= "$line\n";
+ }
}
return $string;
+}
+
+sub _split_description {
+ my ($self, $length, $desc) = @_;
+
+ # 8 for a tab, 2 for the space between option & desc;
+ my $max_length = 78 - ( $length + 8 + 2 );
+
+ return $desc if length $desc <= $max_length;
+
+ my @lines;
+ while (length $desc > $max_length) {
+ my $idx = rindex( substr( $desc, 0, $max_length ), q{ }, );
+ push @lines, substr($desc, 0, $idx);
+ substr($desc, 0, $idx + 1) = q{};
+ }
+ push @lines, $desc;
+
+ return @lines;
}
=head2 warn
Modified: trunk/libgetopt-long-descriptive-perl/t/descriptive.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libgetopt-long-descriptive-perl/t/descriptive.t?rev=65434&op=diff
==============================================================================
--- trunk/libgetopt-long-descriptive-perl/t/descriptive.t (original)
+++ trunk/libgetopt-long-descriptive-perl/t/descriptive.t Wed Dec 1 08:42:39 2010
@@ -2,7 +2,7 @@
use strict;
use warnings;
-use Test::More tests => 37;
+use Test::More tests => 38;
use_ok("Getopt::Long::Descriptive");
@@ -252,3 +252,24 @@
is($opt->foo_bar, 1, 'given value (checked with method)');
is($opt->foo, 1, 'implied value (checked with method)');
}
+
+{
+ local @ARGV;
+ my ($opt, $usage) = describe_options(
+ "%c %o",
+ [ foo => "a foo option" ],
+ [ bar => "a bar option" ],
+ [ baz => "a baz option with a very long description."
+ . " It just goes on for a really long time."
+ . " This allows us to test line wrapping and"
+ . " make sure the output always looks spiffy" ],
+ );
+
+ my $expect = qr/
+ --baz a baz option with a very long description. It just goes on
+ for a really long time. This allows us to test line wrapping
+ and make sure the output always looks spiffy/;
+
+
+ like($usage->text, $expect, 'long option description is wrapped cleanly');
+}
More information about the Pkg-perl-cvs-commits
mailing list