my $opt = $self->{opt};
my $mirror = $opt->{mirror} // do {
my @fail;
for my $sw ($self->index_opt, $self->curl_opt,
my $opt = $self->{opt};
my $mirror = $opt->{mirror} // do {
my @fail;
for my $sw ($self->index_opt, $self->curl_opt,
my ($f) = (split(/|/, $sw, 2))[0];
next unless defined $opt->{$f};
$f = length($f) == 1 ? "-$f" : "--$f";
my ($f) = (split(/|/, $sw, 2))[0];
next unless defined $opt->{$f};
$f = length($f) == 1 ? "-$f" : "--$f";
$self->fail(<<""); # TODO: did you mean "update-external?"
--mirror destination `$location' already exists
$self->fail(<<""); # TODO: did you mean "update-external?"
--mirror destination `$location' already exists
}
if ($location !~ m!\Ahttps?://! && !-d $location) {
$mirror // return $self->fail("$location not a directory");
}
if ($location !~ m!\Ahttps?://! && !-d $location) {
$mirror // return $self->fail("$location not a directory");
$mirror = ext_canonicalize($mirror);
require PublicInbox::LeiMirror;
PublicInbox::LeiMirror->start($self, $mirror => $location);
$mirror = ext_canonicalize($mirror);
require PublicInbox::LeiMirror;
PublicInbox::LeiMirror->start($self, $mirror => $location);
# Workaround bash word-splitting URLs to ['https', ':', '//' ...]
# Maybe there's a better way to go about this in
# contrib/completion/lei-completion.bash
my $re = '';
# Workaround bash word-splitting URLs to ['https', ':', '//' ...]
# Maybe there's a better way to go about this in
# contrib/completion/lei-completion.bash
my $re = '';
# FIXME: bash completion off "http:" or "https:" when the last
# character is a colon doesn't work properly even if we're
# returning "//$HTTP_HOST/$PATH_INFO/", not sure why, could
# FIXME: bash completion off "http:" or "https:" when the last
# character is a colon doesn't work properly even if we're
# returning "//$HTTP_HOST/$PATH_INFO/", not sure why, could
sub _complete_add_external { # for bash, this relies on "compopt -o nospace"
my ($self, @argv) = @_;
my $cfg = $self->_lei_cfg;
sub _complete_add_external { # for bash, this relies on "compopt -o nospace"
my ($self, @argv) = @_;
my $cfg = $self->_lei_cfg;