mirror of
https://github.com/corda/corda.git
synced 2024-12-19 21:17:58 +00:00
CORDA-2623 - Add help screen to Network Builder CLI tool (#4775)
This commit is contained in:
parent
e0121f52ac
commit
f781edccd4
@ -22,6 +22,11 @@ fun main(args: Array<String>) {
|
||||
CommandLine(baseArgs).parse(*args)
|
||||
testDockerConnectivity()
|
||||
|
||||
if (baseArgs.usageHelpRequested) {
|
||||
CommandLine.usage(CliParser(), System.out)
|
||||
return
|
||||
}
|
||||
|
||||
if (baseArgs.gui) {
|
||||
Application.launch(Gui::class.java)
|
||||
return
|
||||
|
@ -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 <Name>:<X500>. Eg; \"Node1:O=Bank A, L=New York, C=US, OU=Org Unit, CN=Service Name\""])
|
||||
var nodesToAdd: MutableMap<String, String> = 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<String, String> {
|
||||
return mapOf(Constants.REGION_ARG_NAME to region.name())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user