diff --git a/tools/network-bootstrapper/src/main/kotlin/net/corda/bootstrapper/Main.kt b/tools/network-bootstrapper/src/main/kotlin/net/corda/bootstrapper/Main.kt index 76623cd21c..341e2bbfd9 100644 --- a/tools/network-bootstrapper/src/main/kotlin/net/corda/bootstrapper/Main.kt +++ b/tools/network-bootstrapper/src/main/kotlin/net/corda/bootstrapper/Main.kt @@ -22,6 +22,11 @@ fun main(args: Array) { CommandLine(baseArgs).parse(*args) testDockerConnectivity() + if (baseArgs.usageHelpRequested) { + CommandLine.usage(CliParser(), System.out) + return + } + if (baseArgs.gui) { Application.launch(Gui::class.java) return diff --git a/tools/network-bootstrapper/src/main/kotlin/net/corda/bootstrapper/cli/CommandParsers.kt b/tools/network-bootstrapper/src/main/kotlin/net/corda/bootstrapper/cli/CommandParsers.kt index 3bf543f6da..fce00d51ba 100644 --- a/tools/network-bootstrapper/src/main/kotlin/net/corda/bootstrapper/cli/CommandParsers.kt +++ b/tools/network-bootstrapper/src/main/kotlin/net/corda/bootstrapper/cli/CommandParsers.kt @@ -17,13 +17,15 @@ open class CliParser { @Option(names = ["-d", "--nodes-directory"], description = ["The directory to search for nodes in"]) var baseDirectory = File(System.getProperty("user.dir")) - @Option(names = ["-b", "--backend"], description = ["The backend to use when instantiating nodes"]) + @Option(names = ["-b", "--backend"], description = ["The backend to use when instantiating nodes. Valid values: LOCAL_DOCKER and AZURE."]) var backendType: Backend.BackendType = Backend.BackendType.LOCAL_DOCKER - @Option(names = ["--add"], split = ":", description = ["The node to add. Format is :. Eg; \"Node1:O=Bank A, L=New York, C=US, OU=Org Unit, CN=Service Name\""]) var nodesToAdd: MutableMap = hashMapOf() + @Option(names = ["-h", "--help"], usageHelp = true, description = ["Display this help message"]) + var usageHelpRequested: Boolean = false + fun isNew(): Boolean { return nodesToAdd.isEmpty() } @@ -50,4 +52,4 @@ class AzureParser : CliParser() { override fun backendOptions(): Map { return mapOf(Constants.REGION_ARG_NAME to region.name()) } -} \ No newline at end of file +}