diff options
author | Eric Wong <e@80x24.org> | 2021-02-25 10:11:04 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-02-26 02:35:49 +0000 |
commit | cf7c27cadd9ce7800beedc72513cf12fda77420f (patch) | |
tree | 375a378c8f79b7535b9accf2e3037726429b3d5d /lib/PublicInbox/LeiImport.pm | |
parent | 9d1d7c2b505454fba331666a951e0f7997500b3c (diff) | |
download | public-inbox-cf7c27cadd9ce7800beedc72513cf12fda77420f.tar.gz |
Since we recommend $IN_FORMAT:$LOCATION, this is hopefully not intrusive (not that this is released software, yet). This is to be consistent with "lei convert" usage. We'll keep "-f" only for output formats, since that is used for "lei q" and "lei convert" for outputs
Diffstat (limited to 'lib/PublicInbox/LeiImport.pm')
-rw-r--r-- | lib/PublicInbox/LeiImport.pm | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/PublicInbox/LeiImport.pm b/lib/PublicInbox/LeiImport.pm index 13e817d0..7f247b64 100644 --- a/lib/PublicInbox/LeiImport.pm +++ b/lib/PublicInbox/LeiImport.pm @@ -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 |