diff options
author | Eric Wong <e@80x24.org> | 2021-03-30 09:39:27 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-03-30 19:15:17 +0000 |
commit | 54da988cfb049ea2ffcc7abeaa3d026224656516 (patch) | |
tree | 69b3385acbbade2ce1736937864fefa49cf3c940 /lib/PublicInbox | |
parent | b40f4f1f81f79577e19e9926e14979625303eb59 (diff) | |
download | public-inbox-54da988cfb049ea2ffcc7abeaa3d026224656516.tar.gz |
I've decided "tag" is a better verb since it seems more widely-used term for associating metadata with data. Not only is it analogous to the "notmuch tag" command, but also makes sense when compared to tooling for manipulating metadata for non-mail data (e.g. audio metadata tags). There's even a Wikipedia entry for it: https://en.wikipedia.org/wiki/Tag_(metadata) whereas "mark" is used in the description, but has no entry of its own with regards to metadata.
Diffstat (limited to 'lib/PublicInbox')
-rw-r--r-- | lib/PublicInbox/LEI.pm | 6 | ||||
-rw-r--r-- | lib/PublicInbox/LeiTag.pm (renamed from lib/PublicInbox/LeiMark.pm) | 26 |
2 files changed, 16 insertions, 16 deletions
diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm index 8a07a4c8..69d48bd1 100644 --- a/lib/PublicInbox/LEI.pm +++ b/lib/PublicInbox/LEI.pm @@ -160,8 +160,8 @@ our %CMD = ( # sorted in order of importance/use: 'plonk' => [ '--threads|--from=IDENT', 'exclude mail matching From: or threads from non-Message-ID searches', qw(stdin| threads|t from|f=s mid=s oid=s), @c_opt ], -'mark' => [ 'KEYWORDS...', - 'set/unset keywords on message(s)', +'tag' => [ 'KEYWORDS...', + 'set/unset keywords and/or labels on message(s)', qw(stdin| in-format|F=s input|i=s@ oid=s@ mid=s@), @c_opt, pass_through('-kw:foo for delete') ], 'forget' => [ '[--stdin|--oid=OID|--by-mid=MID]', @@ -348,7 +348,7 @@ my %CONFIG_KEYS = ( 'leistore.dir' => 'top-level storage location', ); -my @WQ_KEYS = qw(lxs l2m imp mrr cnv p2q mark sol); # internal workers +my @WQ_KEYS = qw(lxs l2m imp mrr cnv p2q tag sol); # internal workers # pronounced "exit": x_it(1 << 8) => exit(1); x_it(13) => SIGPIPE sub x_it ($$) { diff --git a/lib/PublicInbox/LeiMark.pm b/lib/PublicInbox/LeiTag.pm index b187d6e7..56ac25fa 100644 --- a/lib/PublicInbox/LeiMark.pm +++ b/lib/PublicInbox/LeiTag.pm @@ -1,8 +1,8 @@ # Copyright (C) 2021 all contributors <meta@public-inbox.org> # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt> -# handles "lei mark" command -package PublicInbox::LeiMark; +# handles "lei tag" command +package PublicInbox::LeiTag; use strict; use v5.10.1; use parent qw(PublicInbox::IPC PublicInbox::LeiInput); @@ -69,19 +69,19 @@ sub input_eml_cb { # used by PublicInbox::LeiInput::input_fh sub input_mbox_cb { input_eml_cb($_[1], $_[0]) } -sub mark_done_wait { # dwaitpid callback +sub tag_done_wait { # dwaitpid callback my ($arg, $pid) = @_; - my ($mark, $lei) = @$arg; - $lei->child_error($?, 'non-fatal errors during mark') if $?; + my ($tag, $lei) = @$arg; + $lei->child_error($?, 'non-fatal errors during tag') if $?; my $sto = delete $lei->{sto}; my $wait = $sto->ipc_do('done') if $sto; # PublicInbox::LeiStore::done $lei->dclose; } -sub mark_done { # EOF callback for main daemon +sub tag_done { # EOF callback for main daemon my ($lei) = @_; - my $mark = delete $lei->{mark} or return; - $mark->wq_wait_old(\&mark_done_wait, $lei); + my $tag = delete $lei->{tag} or return; + $tag->wq_wait_old(\&tag_done_wait, $lei); } sub net_merge_complete { # callback used by LeiAuth @@ -102,7 +102,7 @@ sub input_net_cb { # imap_each, nntp_each cb input_eml_cb($self, $eml); } -sub lei_mark { # the "lei mark" method +sub lei_tag { # the "lei tag" method my ($lei, @argv) = @_; my $sto = $lei->_lei_store(1); $sto->write_prepare($lei); @@ -113,11 +113,11 @@ sub lei_mark { # the "lei mark" method $self->prepare_inputs($lei, \@argv) or return; grep(defined, @$vmd_mod{qw(+kw +L -L -kw)}) or return $lei->fail('no keywords or labels specified'); - my $ops = { '' => [ \&mark_done, $lei ] }; + my $ops = { '' => [ \&tag_done, $lei ] }; $lei->{auth}->op_merge($ops, $self) if $lei->{auth}; $self->{vmd_mod} = $vmd_mod; - my ($op_c, undef) = $lei->workers_start($self, 'lei_mark', 1, $ops); - $lei->{mark} = $self; + my ($op_c, undef) = $lei->workers_start($self, 'lei_tag', 1, $ops); + $lei->{tag} = $self; net_merge_complete($self) unless $lei->{auth}; $op_c->op_wait_event($ops); } @@ -165,7 +165,7 @@ sub _complete_mark_common ($) { } # FIXME: same problems as _complete_forget_external and similar -sub _complete_mark { +sub _complete_tag { my ($self, @argv) = @_; my @L = eval { $self->_lei_store->search->all_terms('L') }; my @all = ((map { ("+kw:$_", "-kw:$_") } @KW), |