diff options
author | Eric Wong <e@80x24.org> | 2021-09-25 08:49:43 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-09-25 08:53:50 +0000 |
commit | a16e4816546cc098dab392eb1af4667e4961a753 (patch) | |
tree | f2168db0f5677b88504bd45224ab490e0465e816 /lib/PublicInbox/LeiQuery.pm | |
parent | 237fc1f6af4a364f7f3580efea6c5bf62a5cb0a9 (diff) | |
download | public-inbox-a16e4816546cc098dab392eb1af4667e4961a753.tar.gz |
This was written before we had auto-loading, and forget-external should be a rarely-used command that's not worth loading at startup. Do some golfing while we're in the area, too.
Diffstat (limited to 'lib/PublicInbox/LeiQuery.pm')
-rw-r--r-- | lib/PublicInbox/LeiQuery.pm | 6 |
1 files changed, 3 insertions, 3 deletions
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; |