]> Sergey Matveev's repositories - public-inbox.git/commitdiff
lei import: add label completions (+L:$LABEL)
authorEric Wong <e@80x24.org>
Mon, 2 May 2022 18:10:07 +0000 (18:10 +0000)
committerEric Wong <e@80x24.org>
Mon, 2 May 2022 19:10:39 +0000 (19:10 +0000)
This can probably be added for "lei q", too, but we typically
import first.  Labels can probably be made persistent on a
per-folder basis in the future.

lib/PublicInbox/LeiImport.pm

index b9865829e39d6e7f5c7131ee772f99d13e74928a..2d91e4c4aa25e1d428a595712efc1bd6a0cb1256 100644 (file)
@@ -117,6 +117,8 @@ sub _complete_import {
        my ($lei, @argv) = @_;
        my ($re, $cur, $match_cb) = $lei->complete_url_prepare(\@argv);
        my @k = $lei->url_folder_cache->keys($argv[-1] // undef, 1);
        my ($lei, @argv) = @_;
        my ($re, $cur, $match_cb) = $lei->complete_url_prepare(\@argv);
        my @k = $lei->url_folder_cache->keys($argv[-1] // undef, 1);
+       my @L = eval { $lei->_lei_store->search->all_terms('L') };
+       push(@k, map { "+L:$_" } @L);
        my @m = map { $match_cb->($_) } @k;
        my %f = map { $_ => 1 } (@m ? @m : @k);
        if (my $lms = $lei->lms) {
        my @m = map { $match_cb->($_) } @k;
        my %f = map { $_ => 1 } (@m ? @m : @k);
        if (my $lms = $lei->lms) {