sijie commented on a change in pull request #5615: Fix hangs when type invalid
args at command-line
URL: https://github.com/apache/pulsar/pull/5615#discussion_r345561832
##########
File path:
pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdBase.java
##########
@@ -39,14 +39,23 @@ public CmdBase(String cmdName, PulsarAdmin admin) {
jcommander.setProgramName("pulsar-admin " + cmdName);
}
+ private void tryShowCommandUsage() {
+ try {
+ String chosenCommand = jcommander.getParsedCommand();
+ jcommander.usage(chosenCommand);
+ } catch (Exception e) {
+ // it is caused by an invalid command, the invalid command can not
be parsed
+ System.err.println("Invalid command, please use pulsar-admin to
check out how to use");
Review comment:
```suggestion
System.err.println("Invalid command, please use `pulsar-admin
--help` to check out how to use");
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services