Skip to content

Commit

Permalink
cpan/Getopt-Long - Update to version 2.58
Browse files Browse the repository at this point in the history
Changes in version 2.58
-----------------------

* Be more precise about numeric errors (issue #26).
* Add strict to G::L::Parser.
* Doc enhancements, thanks to Elvin Aslanov.
* Silence unnecessary test diagnostics (issue #29).
  • Loading branch information
sciurius authored and jkeenan committed Jun 12, 2024
1 parent c79fe2b commit 1af8c25
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 24 deletions.
3 changes: 2 additions & 1 deletion Porting/Maintainers.pl
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,8 @@ package Maintainers;
},

'Getopt::Long' => {
'DISTRIBUTION' => 'JV/Getopt-Long-2.57.tar.gz',
'DISTRIBUTION' => 'JV/Getopt-Long-2.58.tar.gz',
'SYNCINFO' => 'jkeenan on Wed Jun 12 08:25:08 2024',
'SYNCINFO' => 'jkeenan on Sat Nov 11 13:09:21 2023',
'FILES' => q[cpan/Getopt-Long],
'EXCLUDED' => [
Expand Down
9 changes: 5 additions & 4 deletions cpan/Getopt-Long/lib/Getopt/Long.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# Getopt::Long.pm -- Universal options parsing
# Author : Johan Vromans
# Created On : Tue Sep 11 15:00:12 1990
# Last Modified On: Sat Nov 11 17:48:41 2023
# Update Count : 1808
# Last Modified On: Tue Jun 11 13:18:11 2024
# Update Count : 1811
# Status : Released

################ Module Preamble ################
Expand All @@ -17,7 +17,8 @@ use warnings;

package Getopt::Long;

our $VERSION = 2.57;
# Must match Getopt::Long::Parser::VERSION!
our $VERSION = 2.58;

use Exporter;
use base qw(Exporter);
Expand Down Expand Up @@ -1185,7 +1186,7 @@ sub FindOption ($$$$$) {
warn ("Value \"", $arg, "\" invalid for option ",
$opt, " (",
$type eq 'o' ? "extended " : '',
"number expected)\n");
"integer number expected)\n");
$error++;
# Push back.
unshift (@$argv, $starter.$rest) if defined $rest;
Expand Down
38 changes: 21 additions & 17 deletions cpan/Getopt-Long/lib/Getopt/Long/Parser.pm
Original file line number Diff line number Diff line change
@@ -1,40 +1,44 @@
#! perl

# Parser.pm -- Getopt::Long object oriented interface
# Parser.pm -- Getopt::Long object-oriented interface
# Author : Johan Vromans
# Created On : Thu Nov 9 10:37:00 2023
# Last Modified On: Sat Nov 11 17:48:49 2023
# Update Count : 13
# Last Modified On: Tue Jun 11 13:17:57 2024
# Update Count : 16
# Status : Released

use strict;
use warnings;

package Getopt::Long::Parser;

our $VERSION = 2.57;
# Must match Getopt::Long::VERSION!
our $VERSION = 2.58;

=head1 NAME
Getopt::Long::Parser - Getopt::Long object oriented interface
Getopt::Long::Parser - Getopt::Long object-oriented interface
=head1 SYNOPSIS
use Getopt::Long::Parser;
my $p = Getopt::Long::Parser->new;
$p->configure( ...configuration options... );
if ( $p->getoptions( ...options descriptions... ) ) ...
if ( $p->getoptionsfromarray( \@array, ...options descriptions... ) ) ...
$p->configure( %options );
if ( $p->getoptions( @options ) ) { ... }
if ( $p->getoptionsfromarray( \@array, @options ) ) { ... }
Configuration options can be passed to the constructor:
my $p = Getopt::Long::Parser->new
config => [...configuration options...];
my $p = Getopt::Long::Parser->new( config => [ %options ] );
=head1 DESCRIPTION
Getopt::Long::Parser is an object oriented interface to
C<Getopt::Long::Parser> is an object-oriented interface to
L<Getopt::Long>. See its documentation for configuration and use.
Note that Getopt::Long and Getopt::Long::Parser are not object
oriented. Getopt::Long::Parser emulates an object oriented interface,
Note that C<Getopt::Long> and C<Getopt::Long::Parser> are not
object-oriented.
C<Getopt::Long::Parser> emulates an object-oriented interface,
which should be okay for most purposes.
=head1 CONSTRUCTOR
Expand Down Expand Up @@ -93,7 +97,7 @@ use warnings 'redefine';

=head1 METHODS
In the examples, $p is assumed to be the result of a call to the constructor.
In the examples, C<$p> is assumed to be the result of a call to the constructor.
=head2 configure
Expand All @@ -116,13 +120,13 @@ sub configure {

=head2 getoptionsfromarray
$res = $p->getoptionsfromarray( $aref, @opts );
my $res = $p->getoptionsfromarray( $aref, @opts );
=head2 getoptions
$res = $p->getoptions( @opts );
my $res = $p->getoptions( @opts );
The same as getoptionsfromarray( \@ARGV, @opts ).
The same as C<getoptionsfromarray( \@ARGV, @opts )>.
=cut

Expand Down
2 changes: 1 addition & 1 deletion cpan/Getopt-Long/t/gol-load1.t
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ ok( defined $Getopt::Long::Parser::VERSION,
is( $Getopt::Long::VERSION, $Getopt::Long::Parser::VERSION,
"Parser version matches" );

diag( "Testing Getopt::Long $Getopt::Long::VERSION, Perl $], $^X" );
note( "Testing Getopt::Long $Getopt::Long::VERSION, Perl $], $^X" );
2 changes: 1 addition & 1 deletion cpan/Getopt-Long/t/gol-oo.t
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ die("Getopt::Long version $want_version required--this is only version ".
print "1..14\n";

@ARGV = qw(-Foo -baR --foo bar);
my $p = new Getopt::Long::Parser (config => ["no_ignore_case"]);
my $p = Getopt::Long::Parser->new(config => ["no_ignore_case"]);
undef $opt_baR;
undef $opt_bar;
print "ok 1\n" if $p->getoptions ("foo", "Foo=s");
Expand Down

0 comments on commit 1af8c25

Please sign in to comment.