You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by te...@apache.org on 2022/09/07 07:24:44 UTC

[pulsar] branch branch-2.11 updated: [improve][cli] Pulsar shell: fix custom commands autocompletion (#17479)

This is an automated email from the ASF dual-hosted git repository.

technoboy pushed a commit to branch branch-2.11
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/branch-2.11 by this push:
     new 7b17f87c454 [improve][cli] Pulsar shell: fix custom commands autocompletion (#17479)
7b17f87c454 is described below

commit 7b17f87c4540687dd121fadaca9a32012808909d
Author: Nicolò Boschi <bo...@gmail.com>
AuthorDate: Wed Sep 7 09:22:46 2022 +0200

    [improve][cli] Pulsar shell: fix custom commands autocompletion (#17479)
---
 .../src/main/java/org/apache/pulsar/admin/cli/PulsarAdminTool.java    | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/PulsarAdminTool.java b/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/PulsarAdminTool.java
index 16c9d58efe1..f62819ac640 100644
--- a/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/PulsarAdminTool.java
+++ b/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/PulsarAdminTool.java
@@ -230,7 +230,9 @@ public class PulsarAdminTool {
             jcommander.addCommand(c.getKey(), c.getValue().getConstructor(Supplier.class).newInstance(admin));
         } else {
             // Other mode, all components are initialized.
-            jcommander.addCommand(c.getKey(), c.getValue().getConstructor(Supplier.class).newInstance(admin));
+            if (c.getValue() != null) {
+                jcommander.addCommand(c.getKey(), c.getValue().getConstructor(Supplier.class).newInstance(admin));
+            }
         }
     }