about summary refs log tree commit homepage
path: root/lib/PublicInbox/LeiTag.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/LeiTag.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/LeiTag.pm')
-rw-r--r--lib/PublicInbox/LeiTag.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/PublicInbox/LeiTag.pm b/lib/PublicInbox/LeiTag.pm
index 2dc59f70..8ce96a10 100644
--- a/lib/PublicInbox/LeiTag.pm
+++ b/lib/PublicInbox/LeiTag.pm
@@ -27,8 +27,8 @@ sub pmdir_cb { # called via wq_io_do from LeiPmdir->each_mdir_fn
 
 sub lei_tag { # the "lei tag" method
         my ($lei, @argv) = @_;
-        my $sto = $lei->_lei_store(1);
-        $sto->write_prepare($lei);
+        $lei->{opt}->{'in-format'} //= 'eml' if $lei->{opt}->{stdin};
+        my $sto = $lei->_lei_store(1)->write_prepare($lei);
         my $self = bless {}, __PACKAGE__;
         $lei->ale; # refresh and prepare
         my $vmd_mod = $self->vmd_mod_extract(\@argv);