]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
lei_to_mail: show supported mbox formats on error
authorEric Wong <e@80x24.org>
Wed, 10 Jan 2024 11:18:55 +0000 (11:18 +0000)
committerEric Wong <e@80x24.org>
Thu, 11 Jan 2024 03:00:15 +0000 (03:00 +0000)
Users may accidentally or unknowingly write `mbox' and not know
we support 4 incompatible mbox variants.

lib/PublicInbox/LeiToMail.pm

index de75e99eb837ac175856a2f21a28b66abb91f7a0..008da52ef597dec210a5ddb3b4aa39b5d9ff5563 100644 (file)
@@ -407,7 +407,9 @@ sub new {
                $lei->{opt}->{save} //= \1 if $lei->{cmd} eq 'q';
        } elsif (substr($fmt, 0, 4) eq 'mbox') {
                require PublicInbox::MboxReader;
-               $self->can("eml2$fmt") or die "bad mbox format: $fmt\n";
+               $self->can("eml2$fmt") or die <<EOM;
+E: bad mbox format: $fmt (did you mean: mboxrd, mboxo, mboxcl, or mboxcl2?)
+EOM
                $self->{base_type} = 'mbox';
                if ($lei->{cmd} eq 'q' &&
                                (($lei->path_to_fd($dst) // -1) < 0) &&