From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 0C44E20068 for ; Tue, 2 Feb 2021 11:47:03 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 05/16] lei: complete: do not complete non-arg options w/ help text Date: Tue, 2 Feb 2021 11:46:51 +0000 Message-Id: <20210202114702.29886-6-e@80x24.org> In-Reply-To: <20210202114702.29886-1-e@80x24.org> References: <20210202114702.29886-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Some of our command-line switches take no arguments, and need no completion for those arguments. --- lib/PublicInbox/LEI.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm index ffbc2503..b0a8358a 100644 --- a/lib/PublicInbox/LEI.pm +++ b/lib/PublicInbox/LEI.pm @@ -737,8 +737,7 @@ sub lei__complete { my $opt = quotemeta $1; puts $self, map { my $v = $OPTDESC{$_}; - $v = $v->[0] if ref($v); - my @v = split(/\|/, $v); + my @v = ref($v) ? split(/\|/, $v->[0]) : (); # get rid of ALL CAPS placeholder (e.g "OUT") # (TODO: completion for external paths) shift(@v) if uc($v[0]) eq $v[0];