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-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 C57321F9FE for ; Fri, 19 Feb 2021 12:09:56 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 1/6] t/lei-externals: favor "-o format:$PATHNAME" over "-f" Date: Fri, 19 Feb 2021 05:09:50 -0700 Message-Id: <20210219120955.13891-2-e@80x24.org> In-Reply-To: <20210219120955.13891-1-e@80x24.org> References: <20210219120955.13891-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: It'll be less ambiguous for inputs with "lei convert" and "lei import" cf. https://public-inbox.org/meta/20210217044032.GA17934@dcvr/ --- lib/PublicInbox/LeiToMail.pm | 2 +- t/lei-externals.t | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/PublicInbox/LeiToMail.pm b/lib/PublicInbox/LeiToMail.pm index 8a2d9471..b90756ae 100644 --- a/lib/PublicInbox/LeiToMail.pm +++ b/lib/PublicInbox/LeiToMail.pm @@ -358,7 +358,7 @@ sub new { require PublicInbox::MboxReader if $lei->{opt}->{augment}; (-d $dst || (-e _ && !-w _)) and die "$dst exists and is not a writable file\n"; - $self->can("eml2$fmt") or die "bad mbox --format=$fmt\n"; + $self->can("eml2$fmt") or die "bad mbox format: $fmt\n"; $self->{base_type} = 'mbox'; } else { die "bad mail --format=$fmt\n"; diff --git a/t/lei-externals.t b/t/lei-externals.t index f61b7e52..edfbb2bf 100644 --- a/t/lei-externals.t +++ b/t/lei-externals.t @@ -117,18 +117,18 @@ test_lei(sub { unlike($lei_out, qr!https://example\.com/ibx/!s, 'removed canonical URL'); SKIP: { - ok(!$lei->(qw(q s:prefix -o /dev/null -f maildir)), 'bad maildir'); + ok(!lei(qw(q s:prefix -o maildir:/dev/null)), 'bad maildir'); like($lei_err, qr!/dev/null exists and is not a directory!, 'error shown'); is($? >> 8, 1, 'errored out with exit 1'); - ok(!$lei->(qw(q s:prefix -f mboxcl2 -o), $home), 'bad mbox'); + ok(!lei(qw(q s:prefix -o), "mboxcl2:$home"), 'bad mbox'); like($lei_err, qr!\Q$home\E exists and is not a writable file!, 'error shown'); is($? >> 8, 1, 'errored out with exit 1'); - ok(!$lei->(qw(q s:prefix -o /dev/stdout -f Mbox2)), 'bad format'); - like($lei_err, qr/bad mbox --format=mbox2/, 'error shown'); + ok(!lei(qw(q s:prefix -o Mbox2:/dev/stdout)), 'bad format'); + like($lei_err, qr/bad mbox format: mbox2/, 'error shown'); is($? >> 8, 1, 'errored out with exit 1'); # note, on a Bourne shell users should be able to use either: