From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id A40371F8C8 for ; Tue, 31 Aug 2021 11:21:26 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 02/10] lei prune-mail-sync: handle --all (no args) Date: Tue, 31 Aug 2021 11:21:18 +0000 Message-Id: <20210831112126.13406-3-e@80x24.org> In-Reply-To: <20210831112126.13406-1-e@80x24.org> References: <20210831112126.13406-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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 | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/PublicInbox/LeiMailSync.pm b/lib/PublicInbox/LeiMailSync.pm index 57b56b3c..bf8fb7de 100644 --- a/lib/PublicInbox/LeiMailSync.pm +++ b/lib/PublicInbox/LeiMailSync.pm @@ -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));