push @ret, '-t' if $opt->{threads};
push @ret, '-T', $opt->{threadid} if defined $opt->{threadid};
push @ret, '-O', $opt->{eidx_key} if defined $opt->{eidx_key};
- my $apfx = $self->{-alt_pfx} //= do {
- my @tmp;
- for my $x (@{$self->{-extra} // []}) {
- my $sym = $QPMETHOD_2_SYM{$x->query_parser_method};
- push @tmp, '-Q', $x->{prefix}.$sym.$x->{xprefix};
- }
- # TODO: arbitrary header indexing goes here
- \@tmp;
- };
- (@ret, @$apfx);
+ @ret;
}
# returns a true value if actually handled asynchronously,
}
sub xh_args { # prep getopt args to feed to xap_helper.h socket
- map { ('-d', $_) } shard_dirs($_[0]);
+ my ($self) = @_;
+ my $apfx = $self->{-alt_pfx} //= do {
+ my %dedupe;
+ for my $x (@{$self->{-extra} // []}) {
+ my $sym = $QPMETHOD_2_SYM{$x->query_parser_method};
+ $dedupe{$x->{prefix}.$sym.$x->{xprefix}} = undef;
+ }
+ # TODO: arbitrary header indexing goes here
+ [ sort keys %dedupe ];
+ };
+ ((map { ('-d', $_) } shard_dirs($self)), map { ('-Q', $_) } @$apfx);
}
sub docids_by_postlist ($$) {
my $eml = $ibx->smsg_eml($ibx->over->get_art($num->[0]));
is($eml->header_raw('X-Archives-Hash'), $h1,
'stored message with X-Archives-Hash');
- my @opt = $srch->xh_opt;
+ my @opt = $srch->xh_args;
is $opt[-2], '-Q', 'xap_helper -Q switch';
is $opt[-1], 'xarchiveshash=XXARCHIVESHASH', 'xap_helper -Q arg';
});