mirror of
https://github.com/corda/corda.git
synced 2024-12-24 15:16:45 +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)
|
CommandLine(baseArgs).parse(*args)
|
||||||
testDockerConnectivity()
|
testDockerConnectivity()
|
||||||
|
|
||||||
|
if (baseArgs.usageHelpRequested) {
|
||||||
|
CommandLine.usage(CliParser(), System.out)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (baseArgs.gui) {
|
if (baseArgs.gui) {
|
||||||
Application.launch(Gui::class.java)
|
Application.launch(Gui::class.java)
|
||||||
return
|
return
|
||||||
|
@ -17,13 +17,15 @@ open class CliParser {
|
|||||||
@Option(names = ["-d", "--nodes-directory"], description = ["The directory to search for nodes in"])
|
@Option(names = ["-d", "--nodes-directory"], description = ["The directory to search for nodes in"])
|
||||||
var baseDirectory = File(System.getProperty("user.dir"))
|
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
|
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\""])
|
@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()
|
var nodesToAdd: MutableMap<String, String> = hashMapOf()
|
||||||
|
|
||||||
|
@Option(names = ["-h", "--help"], usageHelp = true, description = ["Display this help message"])
|
||||||
|
var usageHelpRequested: Boolean = false
|
||||||
|
|
||||||
fun isNew(): Boolean {
|
fun isNew(): Boolean {
|
||||||
return nodesToAdd.isEmpty()
|
return nodesToAdd.isEmpty()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user