Better display for 'bucardo list clones'
authorGreg Sabino Mullane <greg@endpoint.com>
Sat, 28 Mar 2015 11:45:45 +0000 (07:45 -0400)
committerGreg Sabino Mullane <greg@endpoint.com>
Sat, 28 Mar 2015 11:45:45 +0000 (07:45 -0400)
Allow clone primes to specify multiple databases.

bucardo

diff --git a/bucardo b/bucardo
index 356e0a9e5b2f2f744f06d92518ef4acbb9c06989..e6a4fd5a4dd7eedd6f0c887f4e6035fae6181ab4 100755 (executable)
--- a/bucardo
+++ b/bucardo
@@ -5320,9 +5320,11 @@ sub clone {
         ## Check for a prime
         if ($word =~ /(?i)prime(?-i)\w*\s*[:=]\s*(\w.*?)\s*$/) {
             $prime = $1;
-            ## This must be a valid database
-            if (! exists $DB->{$prime}) {
-                die qq{The prime option must specify a known database\n};
+            for my $candidate (split /\s*,\s*/ => $prime) {
+                ## This must be a valid database
+                if (! exists $DB->{$candidate}) {
+                    die qq{The prime option must specify a known database (not "$candidate")\n};
+                }
             }
             $options .= "prime=$prime;";
             next;
@@ -6355,16 +6357,16 @@ sub list_clones {
                next if keys %$cloneids and ! exists $cloneids->{$clone->{id}};
                print "Clone #$clone->{id}";
                print " Status: $clone->{status}";
-               defined $clone->{sync} and print " sync: $clone->{sync}";
-               defined $clone->{dbgroup} and print " dbgroup: $clone->{dbgroup}";
-               defined $clone->{relgroup} and print " relgroup: $clone->{relgroup}";
-               defined $clone->{started} and print "  started: $clone->{pstarted}";
-               defined $clone->{ended} and print "  ended: $clone->{pstarted}";
+               defined $clone->{sync} and print "  Sync: $clone->{sync}";
+               defined $clone->{dbgroup} and print " Dbgroup: $clone->{dbgroup}";
+               defined $clone->{relgroup} and print "  Relgroup: $clone->{relgroup}";
+               defined $clone->{started} and print "  Started: $clone->{pstarted}";
+               defined $clone->{ended} and print "  Ended: $clone->{pstarted}";
                if (defined $clone->{options}) {
-                       print " $clone->{options}";
+                       print "  $clone->{options}";
                }
                ## Print last, on a new line:
-               defined $clone->{summary} and print "\n  summary: $clone->{summary}";
+               defined $clone->{summary} and print "\n  Summary: $clone->{summary}";
                print "\n";
        }