]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/LeiConvert.pm
lei convert: use "--output" in failure message
[public-inbox.git] / lib / PublicInbox / LeiConvert.pm
index 395a80f8adee44cb1a5d49f776f1573d174d3395..623599aef883b7cb15b8f63264d23bc157c5da57 100644 (file)
@@ -41,7 +41,7 @@ sub process_inputs { # via wq_do
        delete $lei->{1};
        delete $self->{wcb}; # commit
        my $nr = delete($lei->{-nr_write}) // 0;
-       $lei->err("# converted $nr messages") if $lei->{opt}->{verbose};
+       $lei->qerr("# converted $nr messages");
 }
 
 sub lei_convert { # the main "lei convert" method
@@ -51,15 +51,16 @@ sub lei_convert { # the main "lei convert" method
        my $self = bless {}, __PACKAGE__;
        my $ovv = PublicInbox::LeiOverview->new($lei, 'out-format');
        $lei->{l2m} or return
-               $lei->fail("output not specified or is not a mail destination");
+               $lei->fail('--output unspecified or is not a mail destination');
        my $devfd = $lei->path_to_fd($ovv->{dst}) // return;
        $lei->{opt}->{augment} = 1 if $devfd < 0;
        $self->prepare_inputs($lei, \@inputs) or return;
+       # n.b. {net} {auth} is handled by l2m worker
        my ($op_c, $ops) = $lei->workers_start($self, 1);
        $lei->{wq1} = $self;
        $self->wq_io_do('process_inputs', []);
-       $self->wq_close(1);
-       $op_c->op_wait_event($ops);
+       $self->wq_close;
+       $lei->wait_wq_events($op_c, $ops);
 }
 
 sub ipc_atfork_child {