diff -Nru libgetopt-long-descriptive-perl-0.101/Changes libgetopt-long-descriptive-perl-0.102/Changes --- libgetopt-long-descriptive-perl-0.101/Changes 2018-01-22 00:32:16.000000000 +0000 +++ libgetopt-long-descriptive-perl-0.102/Changes 2018-02-20 19:44:21.000000000 +0000 @@ -1,5 +1,11 @@ Revision history for Getopt-Long-Descriptive +0.102 2018-02-20 14:44:17-05:00 America/New_York + - long spacer lines are now line broken + - "empty" spacer lines no longer have leading whitespace + - option specifications ":+" and ":5" (etc.) now get better + presentation in the usage description + 0.101 2018-01-21 19:32:11-05:00 America/New_York - escape some unescaped braces in regex diff -Nru libgetopt-long-descriptive-perl-0.101/debian/changelog libgetopt-long-descriptive-perl-0.102/debian/changelog --- libgetopt-long-descriptive-perl-0.101/debian/changelog 2018-01-29 20:27:04.000000000 +0000 +++ libgetopt-long-descriptive-perl-0.102/debian/changelog 2018-02-21 15:54:34.000000000 +0000 @@ -1,3 +1,9 @@ +libgetopt-long-descriptive-perl (0.102-1) unstable; urgency=medium + + * Import upstream version 0.102 + + -- Salvatore Bonaccorso Wed, 21 Feb 2018 16:54:34 +0100 + libgetopt-long-descriptive-perl (0.101-1) unstable; urgency=medium [ gregor herrmann ] @@ -165,7 +171,7 @@ * New upstream release [ Salvatore Bonaccorso ] - * New upstream release + * New upstream release -- Salvatore Bonaccorso Sun, 13 Dec 2009 15:26:37 +0100 @@ -179,9 +185,9 @@ [ Salvatore Bonaccorso ] * New upstream release - * debian/control: Add myself to Uploaders. + * debian/control: Add myself to Uploaders. * debian/copyright: Referesh and update to the new revision of the DEP5 - (machine readable format specification). + (machine readable format specification). -- Salvatore Bonaccorso Sat, 28 Nov 2009 07:08:23 +0100 diff -Nru libgetopt-long-descriptive-perl-0.101/lib/Getopt/Long/Descriptive/Opts.pm libgetopt-long-descriptive-perl-0.102/lib/Getopt/Long/Descriptive/Opts.pm --- libgetopt-long-descriptive-perl-0.101/lib/Getopt/Long/Descriptive/Opts.pm 2018-01-22 00:32:16.000000000 +0000 +++ libgetopt-long-descriptive-perl-0.102/lib/Getopt/Long/Descriptive/Opts.pm 2018-02-20 19:44:21.000000000 +0000 @@ -2,7 +2,7 @@ use warnings; package Getopt::Long::Descriptive::Opts; # ABSTRACT: object representing command line switches -$Getopt::Long::Descriptive::Opts::VERSION = '0.101'; +$Getopt::Long::Descriptive::Opts::VERSION = '0.102'; use Scalar::Util qw(blessed weaken); #pod =head1 DESCRIPTION @@ -145,7 +145,7 @@ =head1 VERSION -version 0.101 +version 0.102 =head1 DESCRIPTION diff -Nru libgetopt-long-descriptive-perl-0.101/lib/Getopt/Long/Descriptive/Usage.pm libgetopt-long-descriptive-perl-0.102/lib/Getopt/Long/Descriptive/Usage.pm --- libgetopt-long-descriptive-perl-0.101/lib/Getopt/Long/Descriptive/Usage.pm 2018-01-22 00:32:16.000000000 +0000 +++ libgetopt-long-descriptive-perl-0.102/lib/Getopt/Long/Descriptive/Usage.pm 2018-02-20 19:44:21.000000000 +0000 @@ -2,7 +2,7 @@ use warnings; package Getopt::Long::Descriptive::Usage; # ABSTRACT: the usage description for GLD -$Getopt::Long::Descriptive::Usage::VERSION = '0.101'; +$Getopt::Long::Descriptive::Usage::VERSION = '0.102'; use List::Util qw(max); #pod =head1 SYNOPSIS @@ -37,7 +37,7 @@ sub new { my ($class, $arg) = @_; - my @to_copy = qw(options leader_text show_defaults); + my @to_copy = qw(leader_text options show_defaults); my %copy; @copy{ @to_copy } = @$arg{ @to_copy }; @@ -86,7 +86,9 @@ my $desc = $opt->{desc}; my $assign; if ($desc eq 'spacer') { - $string .= sprintf "$spec_fmt\n", $opt->{spec}; + my @lines = $self->_split_description($length, $opt->{spec}); + + $string .= length($_) ? sprintf("$spec_fmt\n", $_) : "\n" for @lines; next; } @@ -184,7 +186,7 @@ sub _parse_assignment { my ($assign_spec) = @_; - my $argument; + my $result = 'STR'; my $desttype; if (length($assign_spec) < 2) { @@ -192,12 +194,15 @@ return ''; } - $argument = substr $assign_spec, 1, 2; - if ($argument =~ m/^i/ or $argument =~ m/^o/) { + my $optional = substr($assign_spec, 0, 1) eq ':'; + my $argument = substr $assign_spec, 1, 2; + + if ($argument =~ m/^[io]/ or $assign_spec =~ m/^:[+0-9]/) { $result = 'INT'; } elsif ($argument =~ m/^f/) { $result = 'NUM'; } + if (length($assign_spec) > 2) { $desttype = substr($assign_spec, 2, 1); if ($desttype eq '@') { @@ -207,9 +212,11 @@ $result = "KEY=${result}..."; } } - if (substr($assign_spec, 0, 1) eq ':') { + + if ($optional) { return "[=$result]"; } + # with leading space so it can just blindly be appended. return " $result"; } @@ -273,7 +280,7 @@ =head1 VERSION -version 0.101 +version 0.102 =head1 SYNOPSIS diff -Nru libgetopt-long-descriptive-perl-0.101/lib/Getopt/Long/Descriptive.pm libgetopt-long-descriptive-perl-0.102/lib/Getopt/Long/Descriptive.pm --- libgetopt-long-descriptive-perl-0.101/lib/Getopt/Long/Descriptive.pm 2018-01-22 00:32:16.000000000 +0000 +++ libgetopt-long-descriptive-perl-0.102/lib/Getopt/Long/Descriptive.pm 2018-02-20 19:44:21.000000000 +0000 @@ -2,7 +2,7 @@ use warnings; package Getopt::Long::Descriptive; # ABSTRACT: Getopt::Long, but simpler and more powerful -$Getopt::Long::Descriptive::VERSION = '0.101'; +$Getopt::Long::Descriptive::VERSION = '0.102'; use Carp qw(carp croak); use File::Basename (); use Getopt::Long 2.33; @@ -290,14 +290,20 @@ } sub _expand { - return map { {( - spec => $_->[0] || '', - desc => @$_ > 1 ? $_->[1] : 'spacer', - constraint => $_->[2] || {}, - - # if @$_ is 0 then we got [], a spacer - name => @$_ ? _munge((split /[:=|!+]/, $_->[0] || '')[0]) : '', - )} } @_; + my @expanded; + + for my $opt (@_) { + push @expanded, { + spec => $opt->[0] || '', + desc => @$opt > 1 ? $opt->[1] : 'spacer', + constraint => $opt->[2] || {}, + + # if @$_ is 0 then we got [], a spacer + name => @$opt ? _munge((split /[:=|!+]/, $opt->[0] || '')[0]) : '', + }; + } + + return @expanded; } my %HIDDEN = ( @@ -350,9 +356,11 @@ $opt->{constraint}->{one_of} = delete $opt->{desc}; $opt->{desc} = 'hidden'; } + if ($HIDDEN{$opt->{desc}}) { $opt->{constraint}->{hidden}++; } + if ($opt->{constraint}->{one_of}) { for my $one_opt (_expand( @{delete $opt->{constraint}->{one_of}} @@ -370,13 +378,14 @@ push @opts, $one_opt; } } + if ($opt->{constraint}{shortcircuit} && exists $opt->{constraint}{default} ) { carp('option "' . $opt->{name} . q[": 'default' does not make sense for shortcircuit options]); } - push @opts, $opt; + push @opts, $opt; } my @go_conf = @{ $arg->{getopt_conf} || $arg->{getopt} || [] }; @@ -687,7 +696,7 @@ =head1 VERSION -version 0.101 +version 0.102 =head1 SYNOPSIS diff -Nru libgetopt-long-descriptive-perl-0.101/Makefile.PL libgetopt-long-descriptive-perl-0.102/Makefile.PL --- libgetopt-long-descriptive-perl-0.101/Makefile.PL 2018-01-22 00:32:16.000000000 +0000 +++ libgetopt-long-descriptive-perl-0.102/Makefile.PL 2018-02-20 19:44:21.000000000 +0000 @@ -1,4 +1,4 @@ -# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.010. +# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.011. use strict; use warnings; @@ -37,7 +37,7 @@ "Test::More" => "0.96", "Test::Warnings" => "0.005" }, - "VERSION" => "0.101", + "VERSION" => "0.102", "test" => { "TESTS" => "t/*.t" } diff -Nru libgetopt-long-descriptive-perl-0.101/MANIFEST libgetopt-long-descriptive-perl-0.102/MANIFEST --- libgetopt-long-descriptive-perl-0.101/MANIFEST 2018-01-22 00:32:16.000000000 +0000 +++ libgetopt-long-descriptive-perl-0.102/MANIFEST 2018-02-20 19:44:21.000000000 +0000 @@ -1,4 +1,4 @@ -# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.010. +# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.011. Changes LICENSE MANIFEST diff -Nru libgetopt-long-descriptive-perl-0.101/META.json libgetopt-long-descriptive-perl-0.102/META.json --- libgetopt-long-descriptive-perl-0.101/META.json 2018-01-22 00:32:16.000000000 +0000 +++ libgetopt-long-descriptive-perl-0.102/META.json 2018-02-20 19:44:21.000000000 +0000 @@ -5,7 +5,7 @@ "Ricardo Signes " ], "dynamic_config" : 0, - "generated_by" : "Dist::Zilla version 6.010, CPAN::Meta::Converter version 2.150005", + "generated_by" : "Dist::Zilla version 6.011, CPAN::Meta::Converter version 2.150010", "license" : [ "perl_5" ], @@ -69,10 +69,10 @@ "web" : "https://github.com/rjbs/Getopt-Long-Descriptive" } }, - "version" : "0.101", + "version" : "0.102", "x_Dist_Zilla" : { "perl" : { - "version" : "5.024003" + "version" : "5.026001" }, "plugins" : [ { @@ -139,57 +139,57 @@ { "class" : "Dist::Zilla::Plugin::PruneCruft", "name" : "@RJBS/@Filter/PruneCruft", - "version" : "6.010" + "version" : "6.011" }, { "class" : "Dist::Zilla::Plugin::ManifestSkip", "name" : "@RJBS/@Filter/ManifestSkip", - "version" : "6.010" + "version" : "6.011" }, { "class" : "Dist::Zilla::Plugin::MetaYAML", "name" : "@RJBS/@Filter/MetaYAML", - "version" : "6.010" + "version" : "6.011" }, { "class" : "Dist::Zilla::Plugin::License", "name" : "@RJBS/@Filter/License", - "version" : "6.010" + "version" : "6.011" }, { "class" : "Dist::Zilla::Plugin::Readme", "name" : "@RJBS/@Filter/Readme", - "version" : "6.010" + "version" : "6.011" }, { "class" : "Dist::Zilla::Plugin::ExecDir", "name" : "@RJBS/@Filter/ExecDir", - "version" : "6.010" + "version" : "6.011" }, { "class" : "Dist::Zilla::Plugin::ShareDir", "name" : "@RJBS/@Filter/ShareDir", - "version" : "6.010" + "version" : "6.011" }, { "class" : "Dist::Zilla::Plugin::Manifest", "name" : "@RJBS/@Filter/Manifest", - "version" : "6.010" + "version" : "6.011" }, { "class" : "Dist::Zilla::Plugin::TestRelease", "name" : "@RJBS/@Filter/TestRelease", - "version" : "6.010" + "version" : "6.011" }, { "class" : "Dist::Zilla::Plugin::ConfirmRelease", "name" : "@RJBS/@Filter/ConfirmRelease", - "version" : "6.010" + "version" : "6.011" }, { "class" : "Dist::Zilla::Plugin::UploadToCPAN", "name" : "@RJBS/@Filter/UploadToCPAN", - "version" : "6.010" + "version" : "6.011" }, { "class" : "Dist::Zilla::Plugin::MakeMaker", @@ -199,19 +199,19 @@ } }, "name" : "@RJBS/MakeMaker", - "version" : "6.010" + "version" : "6.011" }, { "class" : "Dist::Zilla::Plugin::AutoPrereqs", "name" : "@RJBS/AutoPrereqs", - "version" : "6.010" + "version" : "6.011" }, { "class" : "Dist::Zilla::Plugin::Git::NextVersion", "config" : { "Dist::Zilla::Plugin::Git::NextVersion" : { "first_version" : "0.001", - "version_by_branch" : 0, + "version_by_branch" : 1, "version_regexp" : "(?^:^([0-9]+\\.[0-9]+)$)" }, "Dist::Zilla::Role::Git::Repo" : { @@ -225,22 +225,22 @@ { "class" : "Dist::Zilla::Plugin::PkgVersion", "name" : "@RJBS/PkgVersion", - "version" : "6.010" + "version" : "6.011" }, { "class" : "Dist::Zilla::Plugin::MetaConfig", "name" : "@RJBS/MetaConfig", - "version" : "6.010" + "version" : "6.011" }, { "class" : "Dist::Zilla::Plugin::MetaJSON", "name" : "@RJBS/MetaJSON", - "version" : "6.010" + "version" : "6.011" }, { "class" : "Dist::Zilla::Plugin::NextRelease", "name" : "@RJBS/NextRelease", - "version" : "6.010" + "version" : "6.011" }, { "class" : "Dist::Zilla::Plugin::Test::ChangesHasContent", @@ -250,7 +250,7 @@ { "class" : "Dist::Zilla::Plugin::PodSyntaxTests", "name" : "@RJBS/PodSyntaxTests", - "version" : "6.010" + "version" : "6.011" }, { "class" : "Dist::Zilla::Plugin::Test::ReportPrereqs", @@ -266,7 +266,7 @@ } }, "name" : "@RJBS/TestMoreWithSubtests", - "version" : "6.010" + "version" : "6.011" }, { "class" : "Dist::Zilla::Plugin::PodWeaver", @@ -441,7 +441,7 @@ "branch" : null, "changelog" : "Changes", "signed" : 0, - "tag" : "0.101", + "tag" : "0.102", "tag_format" : "%v", "tag_message" : "v%v" }, @@ -461,7 +461,7 @@ "config" : { "Dist::Zilla::Plugin::Git::Push" : { "push_to" : [ - "origin :", + "rjbs :", "github :" ], "remotes_must_exist" : 0 @@ -503,7 +503,7 @@ "no_forced_deps" : 0 }, "Dist::Zilla::Role::ModuleMetadata" : { - "Module::Metadata" : "1.000031", + "Module::Metadata" : "1.000033", "version" : "0.004" } }, @@ -513,52 +513,52 @@ { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":InstallModules", - "version" : "6.010" + "version" : "6.011" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":IncModules", - "version" : "6.010" + "version" : "6.011" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":TestFiles", - "version" : "6.010" + "version" : "6.011" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExtraTestFiles", - "version" : "6.010" + "version" : "6.011" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExecFiles", - "version" : "6.010" + "version" : "6.011" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":PerlExecFiles", - "version" : "6.010" + "version" : "6.011" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ShareFiles", - "version" : "6.010" + "version" : "6.011" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":MainModule", - "version" : "6.010" + "version" : "6.011" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":AllFiles", - "version" : "6.010" + "version" : "6.011" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":NoFiles", - "version" : "6.010" + "version" : "6.011" } ], "zilla" : { @@ -566,7 +566,7 @@ "config" : { "is_trial" : 0 }, - "version" : "6.010" + "version" : "6.011" } }, "x_breaks" : { diff -Nru libgetopt-long-descriptive-perl-0.101/META.yml libgetopt-long-descriptive-perl-0.102/META.yml --- libgetopt-long-descriptive-perl-0.101/META.yml 2018-01-22 00:32:16.000000000 +0000 +++ libgetopt-long-descriptive-perl-0.102/META.yml 2018-02-20 19:44:21.000000000 +0000 @@ -14,7 +14,7 @@ configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 0 -generated_by: 'Dist::Zilla version 6.010, CPAN::Meta::Converter version 2.150005' +generated_by: 'Dist::Zilla version 6.011, CPAN::Meta::Converter version 2.150010' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -36,10 +36,10 @@ bugtracker: https://github.com/rjbs/Getopt-Long-Descriptive/issues homepage: https://github.com/rjbs/Getopt-Long-Descriptive repository: https://github.com/rjbs/Getopt-Long-Descriptive.git -version: '0.101' +version: '0.102' x_Dist_Zilla: perl: - version: '5.024003' + version: '5.026001' plugins: - class: Dist::Zilla::Plugin::Git::GatherDir @@ -92,64 +92,64 @@ - class: Dist::Zilla::Plugin::PruneCruft name: '@RJBS/@Filter/PruneCruft' - version: '6.010' + version: '6.011' - class: Dist::Zilla::Plugin::ManifestSkip name: '@RJBS/@Filter/ManifestSkip' - version: '6.010' + version: '6.011' - class: Dist::Zilla::Plugin::MetaYAML name: '@RJBS/@Filter/MetaYAML' - version: '6.010' + version: '6.011' - class: Dist::Zilla::Plugin::License name: '@RJBS/@Filter/License' - version: '6.010' + version: '6.011' - class: Dist::Zilla::Plugin::Readme name: '@RJBS/@Filter/Readme' - version: '6.010' + version: '6.011' - class: Dist::Zilla::Plugin::ExecDir name: '@RJBS/@Filter/ExecDir' - version: '6.010' + version: '6.011' - class: Dist::Zilla::Plugin::ShareDir name: '@RJBS/@Filter/ShareDir' - version: '6.010' + version: '6.011' - class: Dist::Zilla::Plugin::Manifest name: '@RJBS/@Filter/Manifest' - version: '6.010' + version: '6.011' - class: Dist::Zilla::Plugin::TestRelease name: '@RJBS/@Filter/TestRelease' - version: '6.010' + version: '6.011' - class: Dist::Zilla::Plugin::ConfirmRelease name: '@RJBS/@Filter/ConfirmRelease' - version: '6.010' + version: '6.011' - class: Dist::Zilla::Plugin::UploadToCPAN name: '@RJBS/@Filter/UploadToCPAN' - version: '6.010' + version: '6.011' - class: Dist::Zilla::Plugin::MakeMaker config: Dist::Zilla::Role::TestRunner: default_jobs: 9 name: '@RJBS/MakeMaker' - version: '6.010' + version: '6.011' - class: Dist::Zilla::Plugin::AutoPrereqs name: '@RJBS/AutoPrereqs' - version: '6.010' + version: '6.011' - class: Dist::Zilla::Plugin::Git::NextVersion config: Dist::Zilla::Plugin::Git::NextVersion: first_version: '0.001' - version_by_branch: 0 + version_by_branch: 1 version_regexp: (?^:^([0-9]+\.[0-9]+)$) Dist::Zilla::Role::Git::Repo: git_version: 2.15.1 @@ -159,19 +159,19 @@ - class: Dist::Zilla::Plugin::PkgVersion name: '@RJBS/PkgVersion' - version: '6.010' + version: '6.011' - class: Dist::Zilla::Plugin::MetaConfig name: '@RJBS/MetaConfig' - version: '6.010' + version: '6.011' - class: Dist::Zilla::Plugin::MetaJSON name: '@RJBS/MetaJSON' - version: '6.010' + version: '6.011' - class: Dist::Zilla::Plugin::NextRelease name: '@RJBS/NextRelease' - version: '6.010' + version: '6.011' - class: Dist::Zilla::Plugin::Test::ChangesHasContent name: '@RJBS/Test::ChangesHasContent' @@ -179,7 +179,7 @@ - class: Dist::Zilla::Plugin::PodSyntaxTests name: '@RJBS/PodSyntaxTests' - version: '6.010' + version: '6.011' - class: Dist::Zilla::Plugin::Test::ReportPrereqs name: '@RJBS/Test::ReportPrereqs' @@ -191,7 +191,7 @@ phase: test type: requires name: '@RJBS/TestMoreWithSubtests' - version: '6.010' + version: '6.011' - class: Dist::Zilla::Plugin::PodWeaver config: @@ -326,7 +326,7 @@ branch: ~ changelog: Changes signed: 0 - tag: '0.101' + tag: '0.102' tag_format: '%v' tag_message: v%v Dist::Zilla::Role::Git::Repo: @@ -341,7 +341,7 @@ config: Dist::Zilla::Plugin::Git::Push: push_to: - - 'origin :' + - 'rjbs :' - 'github :' remotes_must_exist: 0 Dist::Zilla::Role::Git::Repo: @@ -372,55 +372,55 @@ - Moose::Conflicts no_forced_deps: 0 Dist::Zilla::Role::ModuleMetadata: - Module::Metadata: '1.000031' + Module::Metadata: '1.000033' version: '0.004' name: Test::CheckBreaks version: '0.019' - class: Dist::Zilla::Plugin::FinderCode name: ':InstallModules' - version: '6.010' + version: '6.011' - class: Dist::Zilla::Plugin::FinderCode name: ':IncModules' - version: '6.010' + version: '6.011' - class: Dist::Zilla::Plugin::FinderCode name: ':TestFiles' - version: '6.010' + version: '6.011' - class: Dist::Zilla::Plugin::FinderCode name: ':ExtraTestFiles' - version: '6.010' + version: '6.011' - class: Dist::Zilla::Plugin::FinderCode name: ':ExecFiles' - version: '6.010' + version: '6.011' - class: Dist::Zilla::Plugin::FinderCode name: ':PerlExecFiles' - version: '6.010' + version: '6.011' - class: Dist::Zilla::Plugin::FinderCode name: ':ShareFiles' - version: '6.010' + version: '6.011' - class: Dist::Zilla::Plugin::FinderCode name: ':MainModule' - version: '6.010' + version: '6.011' - class: Dist::Zilla::Plugin::FinderCode name: ':AllFiles' - version: '6.010' + version: '6.011' - class: Dist::Zilla::Plugin::FinderCode name: ':NoFiles' - version: '6.010' + version: '6.011' zilla: class: Dist::Zilla::Dist::Builder config: - is_trial: 0 - version: '6.010' + is_trial: '0' + version: '6.011' x_breaks: MooseX::Getopt: '< 0.66' x_contributors: diff -Nru libgetopt-long-descriptive-perl-0.101/README libgetopt-long-descriptive-perl-0.102/README --- libgetopt-long-descriptive-perl-0.101/README 2018-01-22 00:32:16.000000000 +0000 +++ libgetopt-long-descriptive-perl-0.102/README 2018-02-20 19:44:21.000000000 +0000 @@ -1,7 +1,5 @@ - - This archive contains the distribution Getopt-Long-Descriptive, -version 0.101: +version 0.102: Getopt::Long, but simpler and more powerful @@ -11,5 +9,4 @@ the same terms as the Perl 5 programming language system itself. -This README file was generated by Dist::Zilla::Plugin::Readme v6.010. - +This README file was generated by Dist::Zilla::Plugin::Readme v6.011. diff -Nru libgetopt-long-descriptive-perl-0.101/t/descriptive.t libgetopt-long-descriptive-perl-0.102/t/descriptive.t --- libgetopt-long-descriptive-perl-0.101/t/descriptive.t 2018-01-22 00:32:16.000000000 +0000 +++ libgetopt-long-descriptive-perl-0.102/t/descriptive.t 2018-02-20 19:44:21.000000000 +0000 @@ -193,14 +193,14 @@ like( $usage->text, - qr/foo option\n\s+\n\tbar options:\n\s+--bar/, + qr/foo option\n[\t\x20]*\n\tbar options:\n\s+--bar/, "spacer and non-option description found", ); local $SIG{__WARN__} = sub {}; # we know that this will warn; don't care like( $usage->(1), - qr/foo option\n\s+\n\tbar options:\n\s+--bar/, + qr/foo option\n[\t\x20]*\n\tbar options:\n\s+--bar/, "CODEISH: spacer and non-option description found", ); } @@ -218,6 +218,7 @@ [ 'optional|o!' => "optional" ], [ 'increment|i+' => "incremental option" ], ); + like( $usage->text, qr/\[-bhiloSs\]/, @@ -315,22 +316,37 @@ { local @ARGV; my ($opt, $usage) = describe_options( - "%c %o", + "test %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/; + [], # blank line + [ "We can do the same thing with a long spacer. This option line is a" + . " spacer and it will be longer than the 78 column line that we use by" + . " default." ], + [], # blank line + [ xyz => "an xyz option" ], + ); + + my $expect = <<"EOO"; +test [long options...] +\t--foo a foo option +\t--bar a bar option +\t--baz a baz option with a very long description. It just goes on for +\t a really long time. This allows us to test line wrapping and +\t make sure the output always looks spiffy + +\tWe can do the same thing with a long spacer. This option line +\tis a spacer and it will be longer than the 78 column line that +\twe use by default. +\t--xyz an xyz option +EOO - like($usage->text, $expect, 'long option description is wrapped cleanly'); + is($usage->text, $expect, 'long option description is wrapped cleanly'); } { @@ -349,7 +365,7 @@ is($@, '', "no error in eval"); } -{ +subtest "descriptions for option value types" => sub { my $p = \&Getopt::Long::Descriptive::Usage::_parse_assignment; is ($p->('=s'), ' STR', 'string'); @@ -357,6 +373,13 @@ is ($p->('=o'), ' INT', 'int (o)'); is ($p->('=f'), ' NUM', 'float'); + is ($p->(':s'), '[=STR]', 'optional string'); + is ($p->(':i'), '[=INT]', 'optional int (i)'); + is ($p->(':+'), '[=INT]', 'optional int (+)'); + is ($p->(':2'), '[=INT]', 'optional int (2)'); + is ($p->(':o'), '[=INT]', 'optional int (o)'); + is ($p->(':f'), '[=NUM]', 'optional float'); + is ($p->('=s@'), ' STR...', 'strings'); is ($p->('=i@'), ' INT...', 'ints (i)'); is ($p->('=o@'), ' INT...', 'ints (o)'); @@ -366,6 +389,6 @@ is ($p->('=i%'), ' KEY=INT...', 'int maps (i)'); is ($p->('=o%'), ' KEY=INT...', 'int maps (o)'); is ($p->('=f%'), ' KEY=NUM...', 'float maps'); -} +}; done_testing; diff -Nru libgetopt-long-descriptive-perl-0.101/xt/release/changes_has_content.t libgetopt-long-descriptive-perl-0.102/xt/release/changes_has_content.t --- libgetopt-long-descriptive-perl-0.101/xt/release/changes_has_content.t 2018-01-22 00:32:16.000000000 +0000 +++ libgetopt-long-descriptive-perl-0.102/xt/release/changes_has_content.t 2018-02-20 19:44:21.000000000 +0000 @@ -2,7 +2,7 @@ note 'Checking Changes'; my $changes_file = 'Changes'; -my $newver = '0.101'; +my $newver = '0.102'; my $trial_token = '-TRIAL'; my $encoding = 'UTF-8';