From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id B18DA1F934 for ; Sun, 2 May 2021 06:05:42 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 1/6] lei : combine written/results into one line Date: Sun, 2 May 2021 06:05:37 +0000 Message-Id: <20210502060542.11598-2-e@80x24.org> In-Reply-To: <20210502060542.11598-1-e@80x24.org> References: <20210502060542.11598-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/PublicInbox/LeiXSearch.pm b/lib/PublicInbox/LeiXSearch.pm index d212a732..21b15025 100644 --- a/lib/PublicInbox/LeiXSearch.pm +++ b/lib/PublicInbox/LeiXSearch.pm @@ -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;