]> Sergey Matveev's repositories - public-inbox.git/blob - lib/PublicInbox/LeiLsLabel.pm
imap+nntp: share COMPRESS implementation
[public-inbox.git] / lib / PublicInbox / LeiLsLabel.pm
1 # Copyright (C) 2021 all contributors <meta@public-inbox.org>
2 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
3
4 # "lei ls-label" command
5 package PublicInbox::LeiLsLabel;
6 use strict;
7 use v5.10.1;
8
9 sub lei_ls_label { # the "lei ls-label" method
10         my ($lei, @argv) = @_;
11         # TODO: document stats/counts (expensive)
12         my @L = eval { $lei->_lei_store->search->all_terms('L') };
13         my $ORS = $lei->{opt}->{z} ? "\0" : "\n";
14         $lei->out(map { $_.$ORS } @L);
15 }
16
17 1;