Skip to content

Commit

Permalink
style cleanup for mogrename
Browse files Browse the repository at this point in the history
fix the pod docs a bit and change -'s to _'s in options to be consistent with
other utils.
  • Loading branch information
dormando committed Jan 15, 2012
1 parent 8d1c1ae commit 8b35b66
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions mogrename
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ mogrename -- Rename file (key) from one key to another
=head1 SYNOPSIS
$ mogrename [OPTIONS] --old-key='/hello.jpg' --new-key='/bye.jpg'
$ mogrename [OPTIONS] --old-key='/hello.jpg' --new-key='/bye.jpg'
$ mogupload --trackers=host --domain=foo --class=bar \
--old-key='/hello.jpg' --new-key='/bye.jpg'
$ mogupload --trackers=host --domain=foo --class=bar \
--old-key='/hello.jpg' --new-key='/bye.jpg'
$ mogupload --trackers=host1:7001,host2:7001 --domain=foo --class=bar \
--old-key='/hello.jpg' --new-key='/bye.jpg'
$ mogupload --trackers=host1:7001,host2:7001 --domain=foo --class=bar \
--old-key='/hello.jpg' --new-key='/bye.jpg'
=head1 OPTIONS
Expand Down Expand Up @@ -63,13 +63,13 @@ use MogileFS::Utils;
my $utils = MogileFS::Utils->new;

my $usage = "--trackers=host --domain=foo --class=bar "
. "--old-key='/hello.jpg' --new-key='/bye.jpg'";
. "--old_key='/hello.jpg' --new_key='/bye.jpg'";

my $options = $utils->getopts($usage, qw(old-key=s new-key=s));
my $options = $utils->getopts($usage, qw(old_key=s new_key=s));

my $mogile_client = $utils->client;

$mogile_client->rename($options->{'old-key'}, $options->{'new-key'});
$mogile_client->rename($options->{'old_key'}, $options->{'new_key'});

if ($mogile_client->errcode) {
die "Error renaming file (key) from " . $mogile_client->errstr;
Expand Down

0 comments on commit 8b35b66

Please sign in to comment.