X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FLEI.pm;h=3dce02363286597b6106a965277b3395024978f5;hb=c033dde5f54fa886b5bef5b9d5c13aa8624e8df4;hp=bd44cfaeb662046377b58dec6cda9a4af4bc8311;hpb=15a133ea42a51f17958582e2904034424e2866af;p=public-inbox.git diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm index bd44cfae..3dce0236 100644 --- a/lib/PublicInbox/LEI.pm +++ b/lib/PublicInbox/LEI.pm @@ -226,7 +226,7 @@ our %CMD = ( # sorted in order of importance/use: 'rm' => [ '--stdin|LOCATION...', 'remove a message from the index and prevent reindexing', 'stdin|', # /|\z/ must be first for lone dash - @c_opt ], + qw(in-format|F=s lock=s@), @c_opt ], '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 ], @@ -605,16 +605,19 @@ sub incr { $self->{counters}->{$field} += $nr; } +sub pkt_ops { + my ($lei, $ops) = @_; + $ops->{'!'} = [ \&fail_handler, $lei ]; + $ops->{'|'} = [ \&sigpipe_handler, $lei ]; + $ops->{x_it} = [ \&x_it, $lei ]; + $ops->{child_error} = [ \&child_error, $lei ]; + $ops->{incr} = [ \&incr, $lei ]; + $ops; +} + sub workers_start { my ($lei, $wq, $jobs, $ops, $flds) = @_; - $ops = { - '!' => [ \&fail_handler, $lei ], - '|' => [ \&sigpipe_handler, $lei ], - 'x_it' => [ \&x_it, $lei ], - 'child_error' => [ \&child_error, $lei ], - 'incr' => [ \&incr, $lei ], - ($ops ? %$ops : ()), - }; + $ops = pkt_ops($lei, { ($ops ? %$ops : ()) }); $ops->{''} //= [ $wq->can('_lei_wq_eof') || \&wq_eof, $lei ]; my $end = $lei->pkt_op_pair; my $ident = $wq->{-wq_ident} // "lei-$lei->{cmd} worker";