Index: trunk/Nebulous/bin/neb-replicate
===================================================================
--- trunk/Nebulous/bin/neb-replicate	(revision 16183)
+++ trunk/Nebulous/bin/neb-replicate	(revision 18390)
@@ -3,5 +3,5 @@
 # Copyright (C) 2007-2008  Joshua Hoblitt
 #
-# $Id: neb-replicate,v 1.1 2008-01-22 22:10:27 jhoblitt Exp $
+# $Id: neb-replicate,v 1.2 2008-07-01 00:35:11 jhoblitt Exp $
 
 use strict;
@@ -9,5 +9,5 @@
 
 use vars qw( $VERSION );
-$VERSION = '0.01';
+$VERSION = '0.02';
 
 use Nebulous::Client;
@@ -16,5 +16,6 @@
 use Pod::Usage qw( pod2usage );
 
-my ($server, $volume);
+my ($server, $volume, $copies);
+$copies = 1;  # default to making just one copy
 
 $server = $ENV{'NEB_SERVER'} unless $server;
@@ -23,4 +24,5 @@
     'server|s=s'    => \$server,
     'volume|v=s'    => \$volume,
+    'copies|c=i'    => \$copies,
 ) || pod2usage( 2 );
 
@@ -32,4 +34,6 @@
 pod2usage( -msg => "missing key", exitval => 2 )
     unless defined $key;
+pod2usage( -msg => "--copies must be > 0", exitval => 2 )
+    unless $copies > 0;
 
 my $neb = Nebulous::Client->new(
@@ -40,10 +44,12 @@
     unless defined $neb;
 
-if (defined $volume) {
-    $neb->replicate($key, $volume)
-        or die "failed to replicate Nebulous key: $key";
-} else {
-    $neb->replicate($key)
-        or die "failed to replicate Nebulous key: $key";
+for (my $i = 0; $i < $copies; $i++) {
+    if (defined $volume) {
+        $neb->replicate($key, $volume)
+            or die "failed to replicate Nebulous key: $key";
+    } else {
+        $neb->replicate($key)
+            or die "failed to replicate Nebulous key: $key";
+    }
 }
 
@@ -59,5 +65,6 @@
 =head1 SYNOPSIS
 
-    neb-replicate [--server <URL>] [--volume <volume name>] <key>
+    neb-replicate [--server <URL>] [--volume <volume name>]
+                  [--copies <n>] <key>
 
 =head1 DESCRIPTION
@@ -81,4 +88,10 @@
 
 Optional.
+
+=item * --copies|c <n>
+
+The number of new replications to create.
+
+Optional.  Defaults to 0.
 
 =back
