]> Sergey Matveev's repositories - public-inbox.git/commitdiff
lei prune-mail-sync: handle --all (no args)
authorEric Wong <e@80x24.org>
Tue, 31 Aug 2021 11:21:18 +0000 (11:21 +0000)
committerEric Wong <e@80x24.org>
Tue, 31 Aug 2021 11:29:08 +0000 (11:29 +0000)
This still needs tests, but I noticed "--all" w/o "local" or
"remote" was not working correctly since split() returned
an empty array.

lib/PublicInbox/LeiMailSync.pm

index 57b56b3cbd6282c22f3ba1fff89968dbc5c1b7df..bf8fb7de1771ebce60dddbccd9288a8751f43985 100644 (file)
@@ -330,6 +330,7 @@ sub group2folders {
 EOM
        my %x = map { $_ => $_ } split(/,/, $all);
        my @ok = grep(defined, delete(@x{qw(local remote), ''}));
+       push(@ok, '') if $all eq '';
        my @no = keys %x;
        if (@no) {
                @no = (join(',', @no));