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.2 required=3.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF 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 F0DC61F910 for ; Mon, 31 Oct 2022 21:52:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1667253180; bh=b0Xq0ZaByj+i6oHREJBun0kdiZRsdmG5D2u+l5f2smM=; h=From:To:Subject:Date:From; b=RMLeBeJa2cxg//YXmufkTE8FyGTzL/TaKWRRtIIkyGC9SlXq5qhEK8uSQkfpgTJpr BwO9LNhFXayOYtCBhSRAHGh2B8cHfX4zoXaTV5ofmq8hFgdqAbAVm4CZv9DMvsK0+V raiR1GePpHirMS1MU9VzVr1ZRfchUr/Wd3LzOk1w= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] lei up: improve error for multiple lei.q values Date: Mon, 31 Oct 2022 21:52:59 +0000 Message-Id: <20221031215259.20744-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Point users towards the lei.internal.rawstr variable which may be tripping up handling of lei.q after `lei edit-search'. --- lib/PublicInbox/LeiUp.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/PublicInbox/LeiUp.pm b/lib/PublicInbox/LeiUp.pm index 5ad21451..49917339 100644 --- a/lib/PublicInbox/LeiUp.pm +++ b/lib/PublicInbox/LeiUp.pm @@ -32,8 +32,10 @@ sub up1 ($$) { my $rawstr = $lss->{-cfg}->{'lei.internal.rawstr'} // (scalar(@$q) == 1 && substr($q->[0], -1) eq "\n"); if ($rawstr) { - scalar(@$q) > 1 and - die "$f: lei.q has multiple values (@$q) (out=$out)\n"; + die < 1; +$f: lei.q has multiple values (@$q) (out=$out) +$f: while lei.internal.rawstr is set +EOM $lse->query_approxidate($lse->git, $mset_opt->{qstr} = $q->[0]); } else { $mset_opt->{qstr} = $lse->query_argv_to_string($lse->git, $q);