This can be useful for testing remote behavior, or for
augmenting local results. It'll also be possible to explicitly
include/exclude externals via CLI switches (once names are
decided).
my $cb = $lxs->can('prepare_external');
my $ne = $self->_externals_each($cb, $lxs);
$opt->{remote} //= $ne == $lxs->remotes;
my $cb = $lxs->can('prepare_external');
my $ne = $self->_externals_each($cb, $lxs);
$opt->{remote} //= $ne == $lxs->remotes;
- delete($lxs->{remotes}) if !$opt->{remote};
+ if ($opt->{'local'}) {
+ delete($lxs->{remotes}) if !$opt->{remote};
+ } else {
+ delete($lxs->{locals});
+ }
+ }
+ unless ($lxs->locals || $lxs->remotes) {
+ return $self->fail('no local or remote inboxes to search');
}
my $xj = $lxs->concurrency($opt);
my $ovv = PublicInbox::LeiOverview->new($self) or return;
}
my $xj = $lxs->concurrency($opt);
my $ovv = PublicInbox::LeiOverview->new($self) or return;
for my $ibxish (locals($self)) {
$self->wq_do('query_thread_mset', $io, $lei, $ibxish);
}
for my $ibxish (locals($self)) {
$self->wq_do('query_thread_mset', $io, $lei, $ibxish);
}
+ } elsif (locals($self)) {
$self->wq_do('query_mset', $io, $lei);
}
my $i = 0;
$self->wq_do('query_mset', $io, $lei);
}
my $i = 0;
}
ok(!$lei->('q', '-o', "$home/mbox", 's:nope'),
'fails if mbox format unspecified');
}
ok(!$lei->('q', '-o', "$home/mbox", 's:nope'),
'fails if mbox format unspecified');
+ ok(!$lei->(qw(q --no-local s:see)), '--no-local');
+ is($? >> 8, 1, 'proper exit code');
+ like($err, qr/no local or remote.+? to search/, 'no inbox');
my %e = (
TEST_LEI_EXTERNAL_HTTPS => 'https://public-inbox.org/meta/',
TEST_LEI_EXTERNAL_ONION => $onions[int(rand(scalar(@onions)))],
my %e = (
TEST_LEI_EXTERNAL_HTTPS => 'https://public-inbox.org/meta/',
TEST_LEI_EXTERNAL_ONION => $onions[int(rand(scalar(@onions)))],