nodece commented on code in PR #22209:
URL: https://github.com/apache/pulsar/pull/22209#discussion_r1524566269
##########
pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdGenerateDocument.java:
##########
@@ -99,21 +81,29 @@ private boolean needsLangSupport(String module, String
subK) {
return module.equals("functions") &&
Arrays.asList(langSupport).contains(subK);
}
- private void generateDocument(StringBuilder sb, String module,
JCommander obj) {
+ private final Set<String> generatedModule = new HashSet<>();
+
+ private void generateDocument(StringBuilder sb, String module,
CommandLine obj) {
+ // Filter the deprecated command
+ if (generatedModule.contains(module)) {
+ return;
+ }
+ String commandName = obj.getCommandName();
+ generatedModule.add(commandName);
Review Comment:
When a command has an alias, the picocli will add two commands to
commanders, and then `getCommandName()` always return the original name, not
the alias, so we need to skip generated modules.
BTW, the alias means the command is deprecated(sink, source).
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]