lazy_cb should only be used for lei command dispatch and
completion callbacks when the method isn't known at startup.
There's zero reason to use it when the method is known
ahead-of-time, especially when there's a comment pointing
reviewers towards the only possible method it can dispatch.
+sub lazy_cb ($$$) { # $pfx is _complete_ or lei_
my ($self, $cmd, $pfx) = @_;
my $ucmd = $cmd;
$ucmd =~ tr/-/_/;
my ($self, $cmd, $pfx) = @_;
my $ucmd = $cmd;
$ucmd =~ tr/-/_/;
warn("unlink($f): $!\n") unless $!{ENOENT};
} else {
if (!$mrr->{dry_run} && $lei->{cmd} ne 'public-inbox-clone') {
warn("unlink($f): $!\n") unless $!{ENOENT};
} else {
if (!$mrr->{dry_run} && $lei->{cmd} ne 'public-inbox-clone') {
- # calls _finish_add_external
- $lei->lazy_cb('add-external', '_finish_'
- )->($lei, $mrr->{dst});
+ require PublicInbox::LeiAddExternal;
+ PublicInbox::LeiAddExternal::_finish_add_external(
+ $lei, $mrr->{dst});
}
$lei->qerr("# mirrored $mrr->{src} => $mrr->{dst}");
}
}
$lei->qerr("# mirrored $mrr->{src} => $mrr->{dst}");
}