]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/LeiLcat.pm
lei lcat+inspect: start wiring up completion
[public-inbox.git] / lib / PublicInbox / LeiLcat.pm
index effc36828e0000bab29d7d67a3e6d191ec1d3761..81ab1e368ca8756e1ef048d44c2ed4141d403f7d 100644 (file)
@@ -132,4 +132,12 @@ no args allowed on command-line with --stdin
        $lei->_start_query;
 }
 
+sub _complete_lcat {
+       my ($lei, @argv) = @_;
+       my $sto = $lei->_lei_store or return;
+       my $lms = $sto->search->lms or return;
+       my $match_cb = $lei->complete_url_prepare(\@argv);
+       grep(m!\A[a-z]+://!, map { $match_cb->($_) } $lms->folders);
+}
+
 1;