Skip to content

Commit

Permalink
bug fix in example code.
Browse files Browse the repository at this point in the history
  • Loading branch information
tokuhirom committed Apr 16, 2013
1 parent 6afdc97 commit ff6f6ef
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions eg/dist-bumpversion
Expand Up @@ -4,6 +4,7 @@ use warnings;
use Pod::Usage;
use Getopt::Long;
use Module::BumpVersion;
use Version::Next;

my $show;
my $p = Getopt::Long::Parser->new(
Expand All @@ -15,20 +16,22 @@ $p->getoptions(
my $target = shift or pod2usage;

my $bump = Module::BumpVersion->load($target);
my $version = $bump->find_version
or die $bump->errstr;
print "Current version is: $version\n";
if ($show) {
my $version = $bump->find_version
or die $bump->errstr;
print "Current version is: $version\n";
exit 0;
} else {
my $version = $bump->bump_version
or die $bump->errstr;
print "Bumped to $version\n";
}

{
my $next = Version::Next::next_version($version);
$bump->set_version($next);
print "Bumped to $next\n";
}

__END__
=head1 SYNOPSIS
% dist-bumpversion --show .
% dist-bumpversion --show /path/to/Library.pm

0 comments on commit ff6f6ef

Please sign in to comment.