diff --git a/Build.PL b/Build.PL index 77a0460..5826256 100644 --- a/Build.PL +++ b/Build.PL @@ -6,7 +6,7 @@ my $builder = Module::Build->new( module_name => 'cpanspec', license => 'perl', dist_author => 'Steven Pritchard ', - dist_version => '1.60', + dist_version => '1.61', requires => { 'Archive::Tar' => 0, 'Archive::Zip' => 0, diff --git a/Changes b/Changes index 206097c..e52ac6a 100644 --- a/Changes +++ b/Changes @@ -8,6 +8,7 @@ --add-requires Add Requires for this item --add-provides Add Provides for this item --add-buildrequires Add BuildRequires for this item + --version Print the version and exit * Fix path check to allow for a directory without a trailing /. (Found in Module::Install 0.59.) diff --git a/cpanspec b/cpanspec index a882a15..7d8825a 100755 --- a/cpanspec +++ b/cpanspec @@ -10,7 +10,10 @@ # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # -# $Id: cpanspec,v 1.9 2006/03/09 21:21:19 stevenpritchard Exp $ +# $Id: cpanspec,v 1.10 2006/03/11 18:24:45 stevenpritchard Exp $ + +my $NAME="cpanspec"; +my $VERSION='1.61'; =head1 NAME @@ -40,6 +43,7 @@ cpanspec [options] [file [...]] --add-requires Add Requires for this item --add-provides Add Provides for this item --add-buildrequires Add BuildRequires for this item + --version Print the version number and exit =head1 DESCRIPTION @@ -151,6 +155,10 @@ Add Provides for this item. Add BuildRequires for this item. +=item B<-V>, B<--version> + +Print the version number and exit. + =back =head1 AUTHOR @@ -212,6 +220,11 @@ our @add_requires; our @add_provides; our @add_buildrequires; +sub print_version { + print "$NAME version $VERSION\n"; + exit 0; +} + sub verbose(@) { print STDERR @_, "\n" if ($verbose); } @@ -351,6 +364,7 @@ GetOptions( 'add-requires=s' => \@add_requires, 'add-provides=s' => \@add_provides, 'add-buildrequires=s' => \@add_buildrequires, + 'version' => \&print_version, ) or pod2usage({ -exitval => 1, -verbose => 0 }); pod2usage({ -exitval => 0, -verbose => 1 }) if ($help); @@ -887,7 +901,7 @@ END \%changelog * $date $packager $version-$release -- Specfile autogenerated. +- Specfile autogenerated by $NAME $VERSION. END $spec->close();