]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/LeiQuery.pm
lei forget-external: split into separate file
[public-inbox.git] / lib / PublicInbox / LeiQuery.pm
index cb5ac8fb84a72a06907075c7a65c2a7d94c3aec6..c65b00ca0986f5857b6cfc53b0dcba4abe64849c 100644 (file)
@@ -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;