]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/LeiImport.pm
lei import: use --in-format/-F for consistency
[public-inbox.git] / lib / PublicInbox / LeiImport.pm
index 13e817d0b7a54b9fc2057f1f6c7502616da3d730..7f247b640937bf4387ac353112ade62bff197976 100644 (file)
@@ -68,8 +68,7 @@ sub call { # the main "lei import" method
                $self->{0} = $lei->{0};
        }
 
-       # TODO: do we need --format for non-stdin?
-       my $fmt = $lei->{opt}->{'format'};
+       my $fmt = $lei->{opt}->{'in-format'};
        # e.g. Maildir:/home/user/Mail/ or imaps://example.com/INBOX
        for my $input (@inputs) {
                my $input_path = $input;
@@ -159,7 +158,7 @@ sub _import_net { # imap_each, nntp_each cb
 sub import_path_url {
        my ($self, $input) = @_;
        my $lei = $self->{lei};
-       my $ifmt = lc($lei->{opt}->{'format'} // '');
+       my $ifmt = lc($lei->{opt}->{'in-format'} // '');
        # TODO auto-detect?
        if ($input =~ m!\Aimaps?://!i) {
                $lei->{net}->imap_each($input, \&_import_net, $lei->{sto},
@@ -191,7 +190,7 @@ EOM
 sub import_stdin {
        my ($self) = @_;
        my $lei = $self->{lei};
-       _import_fh($lei, delete $self->{0}, '<stdin>', $lei->{opt}->{'format'});
+       _import_fh($lei, delete $self->{0}, '<stdin>', $lei->{opt}->{'in-format'});
 }
 
 no warnings 'once'; # the following works even when LeiAuth is lazy-loaded