This is an automated email from the ASF dual-hosted git repository. guangning pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/master by this push: new 5ad4059 [website][pulsar]: auto generate docs for pulsar subcommand: standalone (#11362) 5ad4059 is described below commit 5ad405988fabb4b28dbdbd5aa5c9a10802f39af1 Author: Li Li <urfreesp...@gmail.com> AuthorDate: Tue Jul 20 14:30:44 2021 +0800 [website][pulsar]: auto generate docs for pulsar subcommand: standalone (#11362) ### Master Issue: #10040 Motivation Support auto generate HTML page for pulsar client cli tool, for example: https://github.com/apache/pulsar/tree/asf-site/content/tools/pulsar-admin ### Modifications generate docs for pulsar subcommand: standalone --- .../main/java/org/apache/pulsar/PulsarStandaloneStarter.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pulsar-broker/src/main/java/org/apache/pulsar/PulsarStandaloneStarter.java b/pulsar-broker/src/main/java/org/apache/pulsar/PulsarStandaloneStarter.java index ac452b4..c764180 100644 --- a/pulsar-broker/src/main/java/org/apache/pulsar/PulsarStandaloneStarter.java +++ b/pulsar-broker/src/main/java/org/apache/pulsar/PulsarStandaloneStarter.java @@ -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'");