about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2023-12-16 11:13:15 +0000
committerEric Wong <e@80x24.org>2023-12-16 13:06:33 +0000
commit478f66df2924dcd84d3ba78235a9086429a3305c (patch)
treef453662a292be935a564dfdf6385645d7bfb5044
parentd6cc0739c5a3648b4e7a776e0b5cf61efa3bb9b1 (diff)
downloadpublic-inbox-478f66df2924dcd84d3ba78235a9086429a3305c.tar.gz
`lei index' should be capable of indexing the the same way
`lei import' does, but without the indexing.  I only noticed
this omission while developing a new feature.
-rw-r--r--lib/PublicInbox/LEI.pm2
-rw-r--r--t/lei-index.t3
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm
index a89bdc51..17431518 100644
--- a/lib/PublicInbox/LEI.pm
+++ b/lib/PublicInbox/LEI.pm
@@ -259,7 +259,7 @@ tag => [ 'KEYWORDS... LOCATION...|--stdin',
 
 'reindex' => [ '', 'reindex all locally-indexed messages', @c_opt ],
 
-'index' => [ 'LOCATION...', 'one-time index from URL or filesystem',
+'index' => [ 'LOCATION... [LABELS...]', 'one-time index from URL or filesystem',
         qw(in-format|F=s kw! offset=i recursive|r exclude=s include|I=s
         verbose|v+ incremental!), @net_opt, # mainly for --proxy=
          @c_opt ],
diff --git a/t/lei-index.t b/t/lei-index.t
index c31b1c3c..2b28f1be 100644
--- a/t/lei-index.t
+++ b/t/lei-index.t
@@ -48,9 +48,10 @@ symlink(File::Spec->rel2abs('t/mda-mime.eml'), "$tmpdir/md1/cur/x:2,S") or
 test_lei({ tmpdir => $tmpdir }, sub {
         my $store_path = "$ENV{HOME}/.local/share/lei/store/";
 
-        lei_ok('index', "$tmpdir/md");
+        lei_ok qw(index +L:md), "$tmpdir/md";
         lei_ok(qw(q mid:qp@example.com));
         my $res_a = json_utf8->decode($lei_out);
+        is_deeply $res_a->[0]->{L}, [ 'md' ], 'label set on index';
         my $blob = $res_a->[0]->{'blob'};
         like($blob, qr/\A[0-9a-f]{40,}\z/, 'got blob from qp@example');
         lei_ok(qw(-C / blob), $blob);