]> Sergey Matveev's repositories - public-inbox.git/commitdiff
lei: complete: do not complete non-arg options w/ help text
authorEric Wong <e@80x24.org>
Tue, 2 Feb 2021 11:46:51 +0000 (11:46 +0000)
committerEric Wong <e@80x24.org>
Wed, 3 Feb 2021 07:32:35 +0000 (07:32 +0000)
Some of our command-line switches take no arguments, and need
no completion for those arguments.

lib/PublicInbox/LEI.pm

index ffbc25039cd0566e8ab7d60246495069c4af3494..b0a8358a0c562c44714eaf6478243d8626b61f66 100644 (file)
@@ -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];