Skip Menu |

This queue is for tickets about the Perl-Version CPAN distribution.

Report information
The Basics
Id: 27649
Status: resolved
Priority: 0/
Queue: Perl-Version

People
Owner: Nobody in particular
Requestors: daxim [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: v0.0.7
Fixed in: (no value)



Subject: dryrun option for perl-reversion
Patch for dryrun mode and command line option. If set, perl-reversion will show what happens, but ultimately not change files.
Subject: perl-reversion-dryrun.diff
--- /usr/bin/perl-reversion +++ perl-reversion @@ -72,6 +72,7 @@ my $current = undef; my $set = undef; my $normal = undef; +my $dryrun = undef; GetOptions( 'help|?' => \$help, @@ -80,6 +81,7 @@ 'set=s' => \$set, 'bump' => \$bump, 'normal' => \$normal, + 'dryrun' => \$dryrun, ) or pod2usage( 2 ); pod2usage( 1 ) if $help; @@ -330,8 +332,12 @@ my $docs = shift; for my $doc ( grep { $docs->{$_}->{dirty} } keys %$docs ) { - note( "Saving $doc\n" ); - write_file( $doc, { atomic => 1 }, $docs->{$doc}->{lines} ); + if ( $dryrun ) { + note( "Would save $doc\n" ); + } else { + note( "Saving $doc\n" ); + write_file( $doc, { atomic => 1 }, $docs->{$doc}->{lines} ); + } } } @@ -449,6 +455,7 @@ -set <version> set the project version number -current <version> specify the current version -normal normalise version strings + -dryrun just go through the motions, but don't actually save files =head1 DESCRIPTION @@ -498,6 +505,11 @@ specied perl-reversion will preserve the formatting of each individual version string. +=item C<< -dryrun >> + +If set, perl-reversion will not save files. Use this to see +what gets changed before it actually happens. + =back =head1 AUTHOR
On Tue Jun 19 19:24:59 2007, DAXIM wrote: Show quoted text
> Patch for dryrun mode and command line option. If set, perl-reversion > will show what happens, but ultimately not change files.
Applied thanks. 0.0.8 will be on CPAN soon. Thanks for the patch :)