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 10CBF1FC99 for ; Tue, 21 Sep 2021 07:42:00 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 11/12] lei q: update messages to reflect --save default Date: Tue, 21 Sep 2021 07:41:58 +0000 Message-Id: <20210921074159.20052-12-e@80x24.org> In-Reply-To: <20210921074159.20052-1-e@80x24.org> References: <20210921074159.20052-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: I wanted to try --dedupe=none for something, but it failed since I forgot --no-save :x So hint users towards --no-save if necessary. --- lib/PublicInbox/LeiSavedSearch.pm | 4 ++-- t/lei-q-save.t | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/PublicInbox/LeiSavedSearch.pm b/lib/PublicInbox/LeiSavedSearch.pm index 89f5c359..637456e4 100644 --- a/lib/PublicInbox/LeiSavedSearch.pm +++ b/lib/PublicInbox/LeiSavedSearch.pm @@ -94,7 +94,7 @@ sub translate_dedupe ($$$) { $dd //= 'content'; return 1 if $dd eq 'content'; # the default return $self->{"-dedupe_$dd"} = 1 if ($dd eq 'oid' || $dd eq 'mid'); - $lei->fail("--dedupe=$dd unsupported with --save"); + $lei->fail("--dedupe=$dd requires --no-save"); } sub up { # updating existing saved search via "lei up" @@ -103,7 +103,7 @@ sub up { # updating existing saved search via "lei up" my $self = bless { ale => $lei->ale }, $cls; my $dir = $dst; output2lssdir($self, $lei, \$dir, \$f) or - return $lei->fail("--save was not used with $dst cwd=". + return $lei->fail("--no-save was used with $dst cwd=". $lei->rel2abs('.')); $self->{-cfg} = $lei->cfg_dump($f) // return $lei->fail; $self->{-ovf} = "$dir/over.sqlite3"; diff --git a/t/lei-q-save.t b/t/lei-q-save.t index 9c17a011..5940018c 100644 --- a/t/lei-q-save.t +++ b/t/lei-q-save.t @@ -69,11 +69,11 @@ test_lei(sub { ok(-s "$home/mbcl2" > $size, 'size increased after up'); ok(!lei(qw(up -q), $home), 'up fails on unknown dir'); - like($lei_err, qr/--save was not used/, 'error noted --save'); + like($lei_err, qr/--no-save was used/, 'error noted --no-save'); lei_ok(qw(q --no-save d:last.week.. -q -o), "$home/no-save"); ok(!lei(qw(up -q), "$home/no-save"), 'up fails on --no-save'); - like($lei_err, qr/--save was not used/, 'error noted --save'); + like($lei_err, qr/--no-save was used/, 'error noted --no-save'); lei_ok qw(ls-search); my @d = split(/\n/, $lei_out); lei_ok qw(ls-search -z); my @z = split(/\0/, $lei_out); @@ -131,7 +131,7 @@ test_lei(sub { unlike($lei_out, qr/mbrd-aug/, 'forget-search completion cleared after forget'); ok(!lei('up', "$home/mbrd-aug"), 'lei up fails after forget'); - like($lei_err, qr/--save was not used/, 'error noted --save'); + like($lei_err, qr/--no-save was used/, 'error noted --no-save'); # dedupe=mid my $o = "$home/dd-mid";