diff options
author | Nicholas Clark <nick@ccl4.org> | 2011-05-19 17:22:43 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2011-05-23 15:07:27 +0100 |
commit | 00ad0422f707d7b873d5558d9ebd749596533bd8 (patch) | |
tree | 5a512e504c89e48157de27491331d53ba2df6f5f /Porting/cmpVERSION.pl | |
parent | 2385f340d0887632a9e7685a0754f81343b0c2a8 (diff) | |
download | perl-00ad0422f707d7b873d5558d9ebd749596533bd8.tar.gz |
Convert cmpVERSION.pl to Getopt::Long from Getopt::Std.
Diffstat (limited to 'Porting/cmpVERSION.pl')
-rwxr-xr-x | Porting/cmpVERSION.pl | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/Porting/cmpVERSION.pl b/Porting/cmpVERSION.pl index 782ab268e0..0856557635 100755 --- a/Porting/cmpVERSION.pl +++ b/Porting/cmpVERSION.pl @@ -16,18 +16,15 @@ use strict; use ExtUtils::MakeMaker; use File::Compare; use File::Spec::Functions qw(catfile catdir devnull); -use Getopt::Std; +use Getopt::Long; -sub usage { -die <<"EOF"; -usage: $0 [ -d -x ] source_dir tag_to_compare -EOF +my ($diffs, $exclude_dual); +unless (GetOptions('diffs' => \$diffs, + 'exclude|x' => \$exclude_dual, + ) && @ARGV == 2) { + die "usage: $0 [ -d -x ] source_dir tag_to_compare"; } -my %opts; -getopts('dx', \%opts) or usage; -@ARGV == 2 or usage; - my ($source_dir, $tag_to_compare) = @ARGV[0,1]; die "$0: '$source_dir' does not look like a Perl directory\n" unless -f catfile($source_dir, "perl.h") && -d catdir($source_dir, "Porting"); @@ -43,7 +40,7 @@ die "$0: '$tag_to_compare' is not a known Git tag\n" unless $tag_exists eq $tag_to_compare; my %dual_files; -if ($opts{x}) { +if ($exclude_dual) { die "With -x, the directory must be '.'\n" unless $source_dir eq '.'; @@ -124,7 +121,7 @@ for (sort @output_files) { print "$_\n"; } -exit unless $opts{d}; +exit unless $diffs; for (sort @output_diffs) { print "\n"; |