From 88326fe994b0fb641ec011afafbe36634b2f44ba Mon Sep 17 00:00:00 2001 From: Greg Sabino Mullane Date: Sat, 10 Sep 2011 16:53:48 -0400 Subject: [PATCH] Allow 'status all' to show detailed information for all syncs --- bucardo | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/bucardo b/bucardo index 0af228937..3fedc9833 100755 --- a/bucardo +++ b/bucardo @@ -4477,13 +4477,28 @@ sub status_detail { ## Arguments: none, parses nouns ## Returns: never, exits - ## Verify that all named syncs exist - my $max = set_sync_status({syncs => \@nouns}); + ## Walk through and check each given sync + ## It must either exist, or be a special key word my @synclist; for my $sync (@nouns) { - $DEBUG and warn "Verify sync: $sync\n"; + + ## Allow a special noise word: 'sync' next if $sync eq 'sync'; + + ## Add everything if we find the special word 'all' + if ($sync eq 'all') { + undef @synclist; + for my $sync (keys %$SYNC) { + ## Turn off the filtering that set_sync_status may have added + $SYNC->{$sync}{filtered} = 0; + push @synclist => $sync; + } + last; + } + + ## If we don't know about this particular sync, give a warning + ## We allow another special word: 'all' if (!exists $SYNC->{$sync}) { ## If a number, skip for ease of "kick name #" toggling $sync !~ /^\d+$/ and die "No such sync: $sync\n"; @@ -4493,6 +4508,10 @@ sub status_detail { } } + + ## Verify that all named syncs exist + my $max = set_sync_status({syncs => \@synclist}); + ## Present each in the order they gave my $loops = 0; for my $sync (@synclist) { @@ -9368,9 +9387,6 @@ The bucardo script uses I<$ENV{HOME}> to look for a F<.bucardorc> file. =head1 BUGS -The 'status' command does not yet return current information, and the start time in particular should be -taken with a grain of salt. - Bug reports and feature requests are always welcome, please visit http://bucardo.org or email bucardo-general@bucardo.org. =head1 SEE ALSO -- 2.39.5