]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/LeiOverview.pm
lei q: support IMAP/IMAPS --output destinations
[public-inbox.git] / lib / PublicInbox / LeiOverview.pm
index 3169bae62569a464146185b08fe23e691aec1406..4db1d8c882e17afebbceafaaf3f0b07ba4df5436 100644 (file)
@@ -59,7 +59,12 @@ sub new {
 
        my $fmt = $opt->{$ofmt_key};
        $fmt = lc($fmt) if defined $fmt;
-       if ($dst =~ s/\A([a-z0-9]+)://is) { # e.g. Maildir:/home/user/Mail/
+       if ($dst =~ m!\A([a-z0-9\+]+)://!is) {
+               defined($fmt) and return $lei->fail(<<"");
+--$ofmt_key=$fmt invalid with URL $dst
+
+               $fmt = lc $1;
+       } elsif ($dst =~ s/\A([a-z0-9]+)://is) { # e.g. Maildir:/home/user/Mail/
                my $ofmt = lc $1;
                $fmt //= $ofmt;
                return $lei->fail(<<"") if $fmt ne $ofmt;