r62506 - in /branches/upstream/libgetopt-euclid-perl/current: Changes MANIFEST META.yml lib/Getopt/Euclid.pm t/pod_cmd_after_cut.t

periapt-guest at users.alioth.debian.org periapt-guest at users.alioth.debian.org
Mon Sep 13 01:45:52 UTC 2010


Author: periapt-guest
Date: Mon Sep 13 01:44:44 2010
New Revision: 62506

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=62506
Log:
[svn-upgrade] new version libgetopt-euclid-perl (0.2.2)

Added:
    branches/upstream/libgetopt-euclid-perl/current/t/pod_cmd_after_cut.t
Modified:
    branches/upstream/libgetopt-euclid-perl/current/Changes
    branches/upstream/libgetopt-euclid-perl/current/MANIFEST
    branches/upstream/libgetopt-euclid-perl/current/META.yml
    branches/upstream/libgetopt-euclid-perl/current/lib/Getopt/Euclid.pm

Modified: branches/upstream/libgetopt-euclid-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libgetopt-euclid-perl/current/Changes?rev=62506&op=diff
==============================================================================
--- branches/upstream/libgetopt-euclid-perl/current/Changes (original)
+++ branches/upstream/libgetopt-euclid-perl/current/Changes Mon Sep 13 01:44:44 2010
@@ -1,111 +1,76 @@
 Revision history for Getopt-Euclid
 
-0.0.1  Sun Jan 30 20:42:36 2005
-       Initial release.
+0.2.2  Thu Sep  9 19:30:55 2010
+  - #28474 - fixed the way name was being parsed
+  - #35895 - line delimiters converted to newlines
+  - #49524 - fixed way POD parsed so that headers after a =cut get parsed
+             properly
+  - #55259 - created $SCRIPT_VERSION variable containing parsed version
+  - #61039 - don't insert default value for options with optional placeholders
+             where the flag is given but a value for the placeholder is not
 
+0.2.1  Sun May 31 12:57:07 2009
+  - Removed BEGIN blocks and simply brought the defined variables to the top
+    of the module (thanks Todd)
+  - Update POD to make sure people don't "use Getopt::Euclid ();"
+  - Removed debugger break point (thanks Diab)
+  - Removed no bugs claim in POD
 
+0.2.0  Sat Aug  4 17:22:31 2007
+  - Added fallback to $main::VERSION if version not specified in Pod
+    (thanks Todd and Thomas)
+  - Added non-zero exit value on bad arg list (thanks Toby)
+  - Changed module behaviour: now removes identified arguments from @ARGV.
+    on successful match (thanks Aran and Tim)
+  - Allowed alternations everywhere (i.e. outside optionals too)
+  - Allowed E<lt> and E<gt> in option specifiers (thanks Wes)
+
+0.1.0  Thu Nov  2 19:47:05 2006
+  - Fixed failure to recognize +integer and 0+integer type specification
+    (thanks Ron)
+  - Added quotemeta'ing of regexically special characters 
+    (thanks Ron)
+  - Repatched :vars<opt_> mode to really export all args
+    (thanks again Tim!)
+
+0.0.9  Thu Oct 26 21:18:46 2006
+  - Patched :vars<opt_> mode to export all args (thanks Tim!)
+
+0.0.8  Sun Oct  8 12:45:17 2006
+  - Remove spurious smart comments
+  - Added missing documentation for placeholder misspecification diagnostic
+  - Made contents of validator subs fallback to main::
+  - Allowed false: flags to be regexes
+  - Fixed readable/writable test for '-' (thanks Thomas)
+  - Added regexes as valid placeholder type constraints
+
+0.0.7  Tue Oct  3 03:54:01 2006
+  - Added :vars<opt_> mode (thanks Tim!)
+  - Fixed option names containing dashes. (thanks Tim!)
+  - Fixed minimal matching mode to more accurately detect clashes (thanks
+    Thomas)
+  - Added user-specified type.error messages (thanks Thomas)
+  - Tightened up checking of placeholder type constraints (thanks Tim)
+
+0.0.6  Sun Sep 17 02:48:04 2006
+  - Removed spurious "compilation failed message" for interface errors
+    (thanks David!)
+  - Added 'repeatable' option (thanks Thomas)
+
+0.0.5  Fri Feb 17 15:52:20 2006
+  - Changed POD::Text to Pod::Text (curse you, case-independent MacOS X!! ;-)
+  - Fixed erroneous bug report when only syntax checking with perl -c
+  - Fixed bug in license defaults (thanks clpoda!)
+  - Added :minimal_keys mode (thanks Thomas)
+
+0.0.4  Thu Aug  4 18:03:28 2005
+  - Fixed embarrassing encoding bug (thanks dakkar!)
+
+0.0.3  Sun Jul 24 20:16:17 2005
+  - Removed need for Smart::Comments
 
 0.0.2  Sat Jul 23 04:37:18 2005
-       No changes logged
+  No changes logged
 
-
-0.0.3  Sun Jul 24 20:16:17 2005
-
-    - Removed need for Smart::Comments
-
-
-0.0.4  Thu Aug  4 18:03:28 2005
-
-    - Fixed embarrassing encoding bug (thanks dakkar!)
-
-
-0.0.5  Fri Feb 17 15:52:20 2006
-
-    - Changed POD::Text to Pod::Text (curse you, case-independent MacOS X!! ;-)
-
-    - Fixed erroneous bug report when only syntax checking with perl -c
-
-    - Fixed bug in license defaults (thanks clpoda!)
-
-    - Added :minimal_keys mode (thanks Thomas)
-
-
-0.0.6  Sun Sep 17 02:48:04 2006
-
-    - Removed spurious "compilation failed message" for interface errors
-      (thanks David!)
-
-    - Added 'repeatable' option (thanks Thomas)
-
-
-
-0.0.7  Tue Oct  3 03:54:01 2006
-
-    - Added :vars<opt_> mode (thanks Tim!)
-
-    - Fixed option names containing dashes. (thanks Tim!)
-
-    - Fixed minimal matching mode to more accurately detect clashes (thanks
-      Thomas)
-
-    - Added user-specified type.error messages (thanks Thomas)
-
-    - Tightened up checking of placeholder type constraints (thanks Tim)
-
-
-0.0.8  Sun Oct  8 12:45:17 2006
-
-    - Remove spurious smart comments
-
-    - Added missing documentation for placeholder misspecification diagnostic
-
-    - Made contents of validator subs fallback to main::
-
-    - Allowed false: flags to be regexes
-
-    - Fixed readable/writable test for '-' (thanks Thomas)
-
-    - Added regexes as valid placeholder type constraints
-
-
-0.0.9  Thu Oct 26 21:18:46 2006
-
-    - Patched :vars<opt_> mode to export all args (thanks Tim!)
-
-
-0.1.0  Thu Nov  2 19:47:05 2006
-
-    - Fixed failure to recognize +integer and 0+integer type specification
-      (thanks Ron)
-
-    - Added quotemeta'ing of regexically special characters 
-      (thanks Ron)
-
-    - Repatched :vars<opt_> mode to really export all args
-      (thanks again Tim!)
-
-
-0.2.0  Sat Aug  4 17:22:31 2007
-
-    - Added fallback to $main::VERSION if version not specified in Pod
-      (thanks Todd and Thomas)
-
-    - Added non-zero exit value on bad arg list (thanks Toby)
-
-    - Changed module behaviour: now removes identified arguments from @ARGV.
-      on successful match (thanks Aran and Tim)
-
-    - Allowed alternations everywhere (i.e. outside optionals too)
-
-    - Allowed E<lt> and E<gt> in option specifiers (thanks Wes)
-
-0.2.1  Sun May 31 12:57:07 2009
-
-    - Removed BEGIN blocks and simply brought the defined variables to the top
-      of the module (thanks Todd)
-
-    - Update POD to make sure people don't "use Getopt::Euclid ();"
-
-    - Removed debugger break point (thanks Diab)
-
-    - Removed no bugs claim in POD
+0.0.1  Sun Jan 30 20:42:36 2005
+  Initial release.

Modified: branches/upstream/libgetopt-euclid-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libgetopt-euclid-perl/current/MANIFEST?rev=62506&op=diff
==============================================================================
--- branches/upstream/libgetopt-euclid-perl/current/MANIFEST (original)
+++ branches/upstream/libgetopt-euclid-perl/current/MANIFEST Mon Sep 13 01:44:44 2010
@@ -3,8 +3,7 @@
 lib/Getopt/Euclid.pm
 lib/Getopt/Euclid/HierDemo.pm
 Makefile.PL
-MANIFEST
-META.yml			# Will be created by "make dist"
+MANIFEST			This list of files
 README
 t/00.load.t
 t/bundle.t
@@ -33,6 +32,7 @@
 t/minimal.t
 t/pod-coverage.t
 t/pod.t
+t/pod_cmd_after_cut.t
 t/quoted_args.t
 t/regex_type.t
 t/repeatable.t
@@ -40,3 +40,4 @@
 t/simple.t
 t/simple_shuffle.t
 t/vars_export.t
+META.yml

Modified: branches/upstream/libgetopt-euclid-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libgetopt-euclid-perl/current/META.yml?rev=62506&op=diff
==============================================================================
--- branches/upstream/libgetopt-euclid-perl/current/META.yml (original)
+++ branches/upstream/libgetopt-euclid-perl/current/META.yml Mon Sep 13 01:44:44 2010
@@ -1,25 +1,26 @@
---- #YAML:1.0
-name:               Getopt-Euclid
-version:            0.2.1
-abstract:           Executable Uniform Command-Line Interface Descriptions
+---
+abstract: 'Executable Uniform Command-Line Interface Descriptions'
 author:
-    - Damian Conway <DCONWAY at cpan.org>
-license:            unknown
-distribution_type:  module
+  - 'Damian Conway <DCONWAY at cpan.org>'
 configure_requires:
-    ExtUtils::MakeMaker:  0
-build_requires:
-    ExtUtils::MakeMaker:  0
+  Module::Build: 0.36
+generated_by: 'Module::Build version 0.3607'
+license: perl
+meta-spec:
+  url: http://module-build.sourceforge.net/META-spec-v1.4.html
+  version: 1.4
+name: Getopt-Euclid
+provides:
+  Getopt::Euclid:
+    file: lib/Getopt/Euclid.pm
+    version: v0.2.2
+  Getopt::Euclid::HierDemo:
+    file: lib/Getopt/Euclid/HierDemo.pm
 requires:
-    File::Spec::Functions:  0
-    List::Util:           0
-    Test::More:           0
-    version:              0
-no_index:
-    directory:
-        - t
-        - inc
-generated_by:       ExtUtils::MakeMaker version 6.50
-meta-spec:
-    url:      http://module-build.sourceforge.net/META-spec-v1.4.html
-    version:  1.4
+  File::Spec::Functions: 0
+  List::Util: 0
+  Test::More: 0
+  version: 0
+resources:
+  license: http://dev.perl.org/licenses/
+version: v0.2.2

Modified: branches/upstream/libgetopt-euclid-perl/current/lib/Getopt/Euclid.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libgetopt-euclid-perl/current/lib/Getopt/Euclid.pm?rev=62506&op=diff
==============================================================================
--- branches/upstream/libgetopt-euclid-perl/current/lib/Getopt/Euclid.pm (original)
+++ branches/upstream/libgetopt-euclid-perl/current/lib/Getopt/Euclid.pm Mon Sep 13 01:44:44 2010
@@ -1,6 +1,6 @@
 package Getopt::Euclid;
 
-use version; $VERSION = qv('0.2.1');
+use version; $VERSION = qv('0.2.2');
 
 use warnings;
 use strict;
@@ -93,6 +93,9 @@
       '.pm file cannot define an explicit import() when using Getopt::Euclid';
 }
 
+# Central variable to store script version for ticket #55259
+our $SCRIPT_VERSION;
+
 sub import {
     shift @_;
     my $minimal_keys;
@@ -137,6 +140,9 @@
       or croak "Getopt::Euclid was unable to access POD\n($!)\nProblem was";
     my $source = do { local $/; <$fh> };
 
+    # Clean up line delimeters
+    s{ [\n\r] }{\n}gx foreach ( $source, @std_POD );
+
     # Clean up significant entities...
     $source =~ s{ E<lt> }{<}gxms;
     $source =~ s{ E<gt> }{>}gxms;
@@ -144,8 +150,8 @@
     # Set up parsing rules...
     my $HWS     = qr{ [^\S\n]*      }xms;
     my $EOHEAD  = qr{ (?= ^=head1 | \z)  }xms;
-    my $POD_CMD = qr{ \n\n = [^\W\d]\w+ [^\n]* \n\n}xms;
-    my $POD_CUT = qr{ \n\n = cut $HWS \n\n}xms;
+    my $POD_CMD = qr{            = [^\W\d]\w+ [^\n]* (?= \n\n )}xms;
+    my $POD_CUT = qr{ (?! \n\n ) = cut $HWS          (?= \n\n )}xms;
 
     my $NAME  = qr{ $HWS NAME    $HWS \n }xms;
     my $VERS  = qr{ $HWS VERSION $HWS \n }xms;
@@ -169,15 +175,16 @@
 
     # Extract POD alone...
     my @chunks = $source =~ m{ $POD_CMD .*? (?: $POD_CUT | \z ) }gxms;
-    my $pod = join q{}, @chunks;
+    my $pod = join "\n\n", @chunks;
 
     # Extract essential interface components...
     my ($prog_name) = ( splitpath($0) )[-1];
 
-    my ($version) =
+    # Extract version info
+    ($SCRIPT_VERSION) =
       $pod =~ m/^=head1 $VERS .*? (\d+(?:[._]\d+)+) .*? $EOHEAD /xms;
-    if ( !defined $version ) {
-        $version = $main::VERSION;
+    if ( !defined $SCRIPT_VERSION ) {
+        $SCRIPT_VERSION = $main::VERSION;
     }
 
     my ( $opt_name, $options ) =
@@ -344,14 +351,14 @@
     $arg_summary .= lc " [$opt_name]" if $opt_name;
     $arg_summary =~ s/\s+/ /gxms;
 
-    $pod =~ s{ ^(=head1 $NAME \s*) .*? (- .*) $EOHEAD }
-            {$1 $prog_name $2}xms;
+    $pod =~ s{ ^(=head1 $NAME \s*) .*? (- .*)? $EOHEAD }
+            {join(' ', $1, $prog_name, $2 || ())}xems;
 
     $pod =~ s{ ^(=head1 $USAGE \s*) .*? (\s*) $EOHEAD }
             {$1 $prog_name $arg_summary $2}xms;
 
     $pod =~ s{ ^(=head1 $VERS    \s*) .*? (\s*) $EOHEAD }
-            {$1 This document refers to $prog_name version $version $2}xms;
+            {$1 This document refers to $prog_name version $SCRIPT_VERSION $2}xms;
 
     # Handle standard args...
     if ( grep { / --man /xms } @ARGV ) {
@@ -370,7 +377,7 @@
         _print_and_exit($pod);
     }
     elsif ( first { $_ eq '--version' } @ARGV ) {
-        print "This is $prog_name version $version\n";
+        print "This is $prog_name version $SCRIPT_VERSION\n";
         if ($licence) {
             print "\n$licence\n";
         }
@@ -670,6 +677,8 @@
                               )
                               if $arg_vars->{$var}{constraint}
                                   && !$arg_vars->{$var}{constraint}->($val);
+                            $entry->{$var} = ''
+                              unless defined( $ARGV{$arg_name} );
                         }
                         next VAR;
                     }
@@ -833,7 +842,6 @@
 }
 
 1;                                 # Magic true value required at end of module
-__END__
 
 =head1 NAME
 
@@ -841,7 +849,7 @@
 
 =head1 VERSION
 
-This document describes Getopt::Euclid version 0.2.1
+This document describes Getopt::Euclid version 0.2.2
 
 =head1 SYNOPSIS
 
@@ -1073,7 +1081,14 @@
     =head1 VERSION
     
     This is alpha release 1.2_34
-    
+
+You may also specify the version number in your code. However, in order for
+Getopt::Euclid to properly read it, it must be in a C<BEGIN> block:
+
+    BEGIN { use version; our $VERSION = qv('1.2.3') }
+    use Getopt::Euclid;
+
+Euclid stores the version as C<$Getopt::Euclid::SCRIPT_VERSION>.
 
 =item =head1 REQUIRED ARGUMENTS
 
@@ -1207,7 +1222,7 @@
         repeatable
 
 When an argument is marked repeatable the corresponding entry of C<%ARGV> will
-not contain a sigle value, but rather an array reference. If the argument also
+not contain a single value, but rather an array reference. If the argument also
 has L<Multiple placeholders>, then the corresponding entry in C<%ARGV> will be
 an array reference with each array entry being a hash reference.
 
@@ -1849,7 +1864,7 @@
 
 Damian Conway  C<< <DCONWAY at cpan.org> >>
 
-Kevin Galinsky
+Kevin Galinsky C<< <kgalinsky+cpan at gmail.com> >>
 
 =head1 LICENCE AND COPYRIGHT
 

Added: branches/upstream/libgetopt-euclid-perl/current/t/pod_cmd_after_cut.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libgetopt-euclid-perl/current/t/pod_cmd_after_cut.t?rev=62506&op=file
==============================================================================
--- branches/upstream/libgetopt-euclid-perl/current/t/pod_cmd_after_cut.t (added)
+++ branches/upstream/libgetopt-euclid-perl/current/t/pod_cmd_after_cut.t Mon Sep 13 01:44:44 2010
@@ -1,0 +1,32 @@
+BEGIN {
+    @ARGV = qw/ -a foo /
+}
+
+use Test::More 'no_plan';
+
+if (eval { require Getopt::Euclid and Getopt::Euclid->import(); 1 }) {
+    ok 1 => 'Optional argument not read as required';
+}
+else {
+    ok 0 => 'Optional argument read as required'; 
+}
+
+=head1 REQUIRED
+
+=over
+
+=item -a <a>
+
+=back
+
+=cut
+
+=head1 OPTIONS
+
+=over
+
+=item -b <b>
+
+=back
+
+=cut




More information about the Pkg-perl-cvs-commits mailing list