]> Sergey Matveev's repositories - public-inbox.git/commitdiff
lei <q|up>: combine written/results into one line
authorEric Wong <e@80x24.org>
Sun, 2 May 2021 06:05:37 +0000 (06:05 +0000)
committerEric Wong <e@80x24.org>
Mon, 3 May 2021 18:45:24 +0000 (18:45 +0000)
Having multiple lines of output mean they can be interleaved in
daemon mode.  Put stats into one line to reduce screen
real-estate size and improve readability.

lib/PublicInbox/LeiXSearch.pm

index d212a7328683db622d87f745f884fbb546493e20..21b1502502b5789f5221076a9a24dcdc2b8f7104 100644 (file)
@@ -359,9 +359,8 @@ sub query_done { # EOF callback for main daemon
        }
        my $wait = $lei->{sto} ? $lei->{sto}->ipc_do('done') : undef;
        $lei->{ovv}->ovv_end($lei);
-       my (@out, $start_mua);
+       my $start_mua;
        if ($l2m) { # close() calls LeiToMail reap_compress
-               @out = (" in $lei->{ovv}->{dst}");
                if (my $out = delete $lei->{old_1}) {
                        if (my $mbout = $lei->{1}) {
                                close($mbout) or return $lei->fail(<<"");
@@ -379,9 +378,11 @@ Error closing $lei->{ovv}->{dst}: $!
                }
        }
        if ($lei->{-progress}) {
-               $lei->qerr('# ', $lei->{-mset_total} // 0, " matches", @out);
+               my $tot = $lei->{-mset_total} // 0;
                my $nr = $lei->{-nr_write} // 0;
-               $lei->qerr("# $nr written to $lei->{ovv}->{dst}") if $l2m;
+               $lei->qerr($l2m ?
+                       "# $nr written to $lei->{ovv}->{dst} ($tot matches)" :
+                       "# $tot matches");
        }
        $lei->start_mua if $start_mua;
        $lei->dclose;