unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
From: Eric Wong <e@80x24.org>
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	[thread overview]
Message-ID: <20210219120955.13891-2-e@80x24.org> (raw)
In-Reply-To: <20210219120955.13891-1-e@80x24.org>

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:

  reply	other threads:[~2021-02-19 12:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-19 12:09 [PATCH 0/6] lei: start working on IMAP writes Eric Wong
2021-02-19 12:09 ` Eric Wong [this message]
2021-02-19 12:09 ` [PATCH 2/6] lei_to_mail: get rid of empty _post_augment_maildir Eric Wong
2021-02-19 12:09 ` [PATCH 3/6] tests: require Mail::IMAPClient for IMAP tests Eric Wong
2021-02-19 12:09 ` [PATCH 4/6] net_reader: handle single-message IMAP mailboxes Eric Wong
2021-02-19 12:09 ` [PATCH 5/6] net_writer: start implementing IMAP write support Eric Wong
2021-02-19 12:09 ` [PATCH 6/6] URIimap: overload "" to ->as_string Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://public-inbox.org/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210219120955.13891-2-e@80x24.org \
    --to=e@80x24.org \
    --cc=meta@public-inbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).