about summary refs log tree commit homepage
path: root/lib/PublicInbox/LeiRm.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-11-02 18:14:45 +0000
committerEric Wong <e@80x24.org>2021-11-02 19:07:06 +0000
commita3069519309207e204e7686925ef188b4ea4effb (patch)
treea60488371f2137cc9de87a7d4b1ddc3970700a4c /lib/PublicInbox/LeiRm.pm
parent0054246c2d03fcc91bc899da5ef41a68f505e542 (diff)
downloadpublic-inbox-a3069519309207e204e7686925ef188b4ea4effb.tar.gz
lei <rediff|rm|tag>: stdin implies `-F eml'
These commands are usually run on a single message, so saving
the user the trouble of typing `-F eml' on the command-line
seems reasonable.  I don't think commands like "index" and
"import" will be too useful for single messages, though.
Diffstat (limited to 'lib/PublicInbox/LeiRm.pm')
-rw-r--r--lib/PublicInbox/LeiRm.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/PublicInbox/LeiRm.pm b/lib/PublicInbox/LeiRm.pm
index 62423ac9..00b12485 100644
--- a/lib/PublicInbox/LeiRm.pm
+++ b/lib/PublicInbox/LeiRm.pm
@@ -16,7 +16,7 @@ sub input_eml_cb { # used by PublicInbox::LeiInput::input_fh
 sub lei_rm {
         my ($lei, @inputs) = @_;
         $lei->_lei_store(1)->write_prepare($lei);
-        $lei->{opt}->{'in-format'} //= 'eml';
+        $lei->{opt}->{'in-format'} //= 'eml' if $lei->{opt}->{stdin};
         my $self = bless {}, __PACKAGE__;
         $self->prepare_inputs($lei, \@inputs) or return;
         $lei->{-err_type} = 'non-fatal';