X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FLeiQuery.pm;fp=lib%2FPublicInbox%2FLeiQuery.pm;h=c65b00ca0986f5857b6cfc53b0dcba4abe64849c;hb=a16e4816546cc098dab392eb1af4667e4961a753;hp=cb5ac8fb84a72a06907075c7a65c2a7d94c3aec6;hpb=237fc1f6af4a364f7f3580efea6c5bf62a5cb0a9;p=public-inbox.git diff --git a/lib/PublicInbox/LeiQuery.pm b/lib/PublicInbox/LeiQuery.pm index cb5ac8fb..c65b00ca 100644 --- a/lib/PublicInbox/LeiQuery.pm +++ b/lib/PublicInbox/LeiQuery.pm @@ -158,11 +158,11 @@ no query allowed on command-line with --stdin # shell completion helper called by lei__complete sub _complete_q { my ($self, @argv) = @_; - my $ext = qr/\A(?:-I|(?:--(?:include|exclude|only)))\z/; my @cur; + my $cb = $self->lazy_cb(qw(forget-external _complete_)); while (@argv) { - if ($argv[-1] =~ $ext) { - my @c = $self->_complete_forget_external(@cur); + if ($argv[-1] =~ /\A(?:-I|(?:--(?:include|exclude|only)))\z/) { + my @c = $cb->($self, @cur); # try basename match: if (scalar(@cur) == 1 && index($cur[0], '/') < 0) { my $all = $self->externals_each;