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.
---
 lib/PublicInbox/LeiRediff.pm | 2 +-
 lib/PublicInbox/LeiRm.pm     | 2 +-
 lib/PublicInbox/LeiTag.pm    | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/PublicInbox/LeiRediff.pm b/lib/PublicInbox/LeiRediff.pm
index f0521bcc..c312d90f 100644
--- a/lib/PublicInbox/LeiRediff.pm
+++ b/lib/PublicInbox/LeiRediff.pm
@@ -256,7 +256,7 @@ sub lei_rediff {
        ($lei->{opt}->{drq} && !$lei->{opt}->{verbose}) and
                $lei->{opt}->{quiet} //= 1;
        $lei->_lei_store(1)->write_prepare($lei);
-       $lei->{opt}->{'in-format'} //= 'eml';
+       $lei->{opt}->{'in-format'} //= 'eml' if $lei->{opt}->{stdin};
        # maybe it's a non-email (code) blob from a coderepo
        my $git_dirs = $lei->{opt}->{'git-dir'} //= [];
        if ($lei->{opt}->{cwd} // 1) {
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';
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);
--
unsubscribe: one-click, see List-Unsubscribe header
archive: https://public-inbox.org/meta/

Reply via email to