mirror of
https://github.com/corda/corda.git
synced 2025-02-27 11:36:42 +00:00
Make doorman print the help if commands are missing from the command line (#139)
This commit is contained in:
parent
71681e0e0a
commit
91c9dad6cc
@ -84,10 +84,11 @@ fun parseCommandLine(vararg args: String): CommandLineOptions {
|
||||
val helpOption = optionParser.acceptsAll(listOf("h", "?", "help"), "show help").forHelp();
|
||||
|
||||
val optionSet = optionParser.parse(*args)
|
||||
// Print help and exit on help option.
|
||||
if (optionSet.has(helpOption)) {
|
||||
// Print help and exit on help option or if there are missing options.
|
||||
if (optionSet.has(helpOption) || !optionSet.has(configFileArg) || !optionSet.has(initialNetworkParametersArg)) {
|
||||
throw ShowHelpException(optionParser)
|
||||
}
|
||||
|
||||
val configFile = Paths.get(optionSet.valueOf(configFileArg)).toAbsolutePath()
|
||||
val initialNetworkParameters = Paths.get(optionSet.valueOf(initialNetworkParametersArg)).toAbsolutePath()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user