Being able to update 1 folder, or all (local) folders is
sometimes too limiting, so just allow updating any subset
of local folders.
import-before! lock=s@ rsyncable alert=s@ mua=s verbose|v+
shared color! mail-sync!), @c_opt, opt_dash('limit|n=i', '[0-9]+') ],
import-before! lock=s@ rsyncable alert=s@ mua=s verbose|v+
shared color! mail-sync!), @c_opt, opt_dash('limit|n=i', '[0-9]+') ],
-'up' => [ 'OUTPUT|--all', 'update saved search',
+'up' => [ 'OUTPUT...|--all', 'update saved search',
qw(jobs|j=s lock=s@ alert=s@ mua=s verbose|v+ all:s), @c_opt ],
'lcat' => [ '--stdin|MSGID_OR_URL...', 'display local copy of message(s)',
qw(jobs|j=s lock=s@ alert=s@ mua=s verbose|v+ all:s), @c_opt ],
'lcat' => [ '--stdin|MSGID_OR_URL...', 'display local copy of message(s)',
$lei->{lse} = $lei->_lei_store(1)->search;
my $opt = $lei->{opt};
$opt->{save} = -1;
$lei->{lse} = $lei->_lei_store(1)->search;
my $opt = $lei->{opt};
$opt->{save} = -1;
if (defined $opt->{all}) {
if (defined $opt->{all}) {
+ return $lei->fail("--all and @outs incompatible") if @outs;
length($opt->{mua}//'') and return
$lei->fail('--all and --mua= are incompatible');
length($opt->{mua}//'') and return
$lei->fail('--all and --mua= are incompatible');
$opt->{all} eq 'local' or return
$lei->fail('only --all=local works at the moment');
my @all = PublicInbox::LeiSavedSearch::list($lei);
$opt->{all} eq 'local' or return
$lei->fail('only --all=local works at the moment');
my @all = PublicInbox::LeiSavedSearch::list($lei);
- my @local = grep(!m!\Aimaps?://!i, @all);
+ @local = grep(!m!\Aimaps?://!i, @all);
+ } else {
+ @local = @outs;
+ }
+ if (scalar(@outs) > 1) {
+ length($opt->{mua}//'') and return $lei->fail(<<EOM);
+multiple outputs and --mua= are incompatible
+EOM
+ # TODO:
+ return $lei->fail(<<EOM) if grep(m!\Aimaps?://!i, @outs);
+multiple destinations only supported for local outputs (FIXME)
+EOM
+ }
+ if (scalar(@local) > 1) {
$lei->_lei_store->write_prepare($lei); # share early
# daemon mode, re-dispatch into our event loop w/o
# creating an extra fork-level
$lei->_lei_store->write_prepare($lei); # share early
# daemon mode, re-dispatch into our event loop w/o
# creating an extra fork-level
$lei->event_step_init;
$op_c->{ops} = { '' => [$lei->can('dclose'), $lei] };
} else {
$lei->event_step_init;
$op_c->{ops} = { '' => [$lei->can('dclose'), $lei] };
} else {