mirror of
https://github.com/corda/corda.git
synced 2025-03-22 12:05:59 +00:00
ENT-3333: Return error code for invalid cmdline options (#4910)
If an invalid command line option is specified and the parser is unable to parse the input, return an error code to the caller. This is useful in scripting scenarios where it might be important to detect that Corda failed to start due to invalid command line parameters
This commit is contained in:
parent
0ab6b4de89
commit
eabd056511
@ -71,7 +71,7 @@ fun CordaCliWrapper.start(args: Array<String>) {
|
||||
Help.Ansi.AUTO
|
||||
}
|
||||
val results = cmd.parseWithHandlers(RunLast().useOut(System.out).useAnsi(defaultAnsiMode),
|
||||
DefaultExceptionHandler<List<Any>>().useErr(System.err).useAnsi(defaultAnsiMode),
|
||||
DefaultExceptionHandler<List<Any>>().useErr(System.err).useAnsi(defaultAnsiMode).andExit(ExitCodes.FAILURE),
|
||||
*args)
|
||||
// If an error code has been returned, use this and exit
|
||||
results?.firstOrNull()?.let {
|
||||
|
Loading…
x
Reference in New Issue
Block a user