[website][pulsar]: auto generate docs for pulsar subcommand: standalone
### Master Issue:
Motivation
Support auto generate HTML page for pulsar client cli tool, for example:
### Modifications
generate docs for pulsar subcommand: standalone
@@ -20,15 +20,19 @@ package org.apache.pulsar;
import static org.apache.commons.lang3.StringUtils.isBlank;
import com.beust.jcommander.JCommander;
+import com.beust.jcommander.Parameter;
import java.io.FileInputStream;
import java.util.Arrays;
import org.apache.logging.log4j.LogManager;
import org.apache.pulsar.broker.ServiceConfiguration;
import org.apache.pulsar.common.configuration.PulsarConfigurationLoader;
+import org.apache.pulsar.common.util.CmdGenerateDocs;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class PulsarStandaloneStarter extends PulsarStandalone {
+ @Parameter(names = {"-g", "--generate-docs"}, description = "Generate docs")
+ private boolean generateDocs = false;
private static final Logger log = LoggerFactory.getLogger(PulsarStandaloneStarter.class);
@@ -42,6 +46,12 @@ public class PulsarStandaloneStarter extends PulsarStandalone {
jcommander.usage();
return;
}
+ if (this.generateDocs) {
+ CmdGenerateDocs cmd = new CmdGenerateDocs("pulsar");
+ cmd.addCommand("standalone", this);
+ cmd.run(null);
+ System.exit(0);
+ }
if (this.isNoBroker() && this.isOnlyBroker()) {
log.error("Only one option is allowed between '--no-broker' and '--only-broker'");
