sub prepare_inputs { # returns undef on error
my ($self, $lei, $inputs) = @_;
my $in_fmt = $lei->{opt}->{'in-format'};
- my $sync = $lei->{opt}->{sync} ? {} : undef; # using LeiMailSync
+ my $sync = $lei->{opt}->{'mail-sync'} ? {} : undef; # using LeiMailSync
if ($lei->{opt}->{stdin}) {
@$inputs and return
$lei->fail("--stdin and @$inputs do not mix");
}
if ($sync && $sync->{no}) {
return $lei->fail(<<"") if !$sync->{ok};
---sync specified but no inputs support it
+--mail-sync specified but no inputs support it
# non-fatal if some inputs support support sync
- $lei->err("# --sync will only be used for @{$sync->{ok}}");
- $lei->err("# --sync is not supported for: @{$sync->{no}}");
+ $lei->err("# --mail-sync will only be used for @{$sync->{ok}}");
+ $lei->err("# --mail-sync is not supported for: @{$sync->{no}}");
}
if ($net) {
$net->{-can_die} = 1;
$ent->{'lei/store'} = \@docids if @docids;
my $lms = $lse->lms;
if (my $loc = $lms ? $lms->locations_for($oidhex) : undef) {
- $ent->{sync} = $loc;
+ $ent->{'mail-sync'} = $loc;
}
}
$ent;
lei_ok('inspect', "blob:$out->[5]->{blob}");
my $x = json_utf8->decode($lei_out);
is(ref($x->{'lei/store'}), 'ARRAY', 'lei/store in inspect');
- is(ref($x->{sync}), 'HASH', 'sync in inspect');
- is(ref($x->{sync}->{$k[0]}), 'ARRAY', 'UID arrays in inspect');
+ is(ref($x->{'mail-sync'}), 'HASH', 'sync in inspect');
+ is(ref($x->{'mail-sync'}->{$k[0]}), 'ARRAY', 'UID arrays in inspect');
my $psgi_attach = 'cfa3622cbeffc9bd6b0fc66c4d60d420ba74f60d';
lei_ok('blob', $psgi_attach);
lei_ok('inspect', "blob:$res->[0]->{blob}");
$inspect = json_utf8->decode($lei_out);
is(ref(delete $inspect->{"lei/store"}), 'ARRAY', 'lei/store IDs');
- is_deeply($inspect, { sync => { "maildir:$md" => [ 'x:2,S' ] } },
+ is_deeply($inspect, { 'mail-sync' => { "maildir:$md" => [ 'x:2,S' ] } },
'maildir sync info as expected');
lei_ok qw(ls-mail-sync);