From 8b91bd5f929bf166ee3a79dec43fba0e68b1dc8e Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 21 Sep 2021 07:41:55 +0000 Subject: lei: various completion improvements "lei export-kw" no longer completes for anonymous sources. More commands use "lei refresh-mail-sync" as a basis for their completion work, as well. ";AUTH=ANONYMOUS@" is stripped from completions since it was preventing bash completion from working on AUTH=ANONYMOUS IMAP URLs. I'm not sure if there's a better way, but all of our code works fine without specifying AUTH=ANONYMOUS as a command-line arg. Finally, we fallback to using more candidates if none can be found, allowing multiple URLs to be completed. --- lib/PublicInbox/LeiInspect.pm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'lib/PublicInbox/LeiInspect.pm') diff --git a/lib/PublicInbox/LeiInspect.pm b/lib/PublicInbox/LeiInspect.pm index 8e128580..2158b996 100644 --- a/lib/PublicInbox/LeiInspect.pm +++ b/lib/PublicInbox/LeiInspect.pm @@ -269,10 +269,9 @@ no args allowed on command-line with --stdin } sub _complete_inspect { - my ($lei, @argv) = @_; - my $lms = $lei->lms or return; - my $match_cb = $lei->complete_url_prepare(\@argv); - map { $match_cb->($_) } $lms->folders; + require PublicInbox::LeiRefreshMailSync; + PublicInbox::LeiRefreshMailSync::_complete_refresh_mail_sync(@_); + # TODO: message-ids?, blobs? could get expensive... } 1; -- cgit v1.2.3-24-ge0c7