From 047489ba7e8fb724e70963f43eba92ffbd94376f Mon Sep 17 00:00:00 2001 From: Thomas Schroeter Date: Fri, 17 Aug 2018 13:55:41 +0100 Subject: [PATCH] Allow base dir and config file (#1331) --- .../src/main/kotlin/net/corda/bridge/FirewallArgsParser.kt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/bridge/src/main/kotlin/net/corda/bridge/FirewallArgsParser.kt b/bridge/src/main/kotlin/net/corda/bridge/FirewallArgsParser.kt index 0dc908cc15..cb3b345c54 100644 --- a/bridge/src/main/kotlin/net/corda/bridge/FirewallArgsParser.kt +++ b/bridge/src/main/kotlin/net/corda/bridge/FirewallArgsParser.kt @@ -45,11 +45,9 @@ class ArgsParser { fun parse(vararg args: String): CmdLineOptions { val optionSet = optionParser.parse(*args) - require(!optionSet.has(baseDirectoryArg) || !optionSet.has(configFileArg)) { - "${baseDirectoryArg.options()[0]} and ${configFileArg.options()[0]} cannot be specified together" - } val baseDirectory = Paths.get(optionSet.valueOf(baseDirectoryArg)).normalize().toAbsolutePath() - val configFile = baseDirectory / optionSet.valueOf(configFileArg) + val configFilePath = Paths.get(optionSet.valueOf(configFileArg)) + val configFile = if (configFilePath.isAbsolute) configFilePath else baseDirectory / configFilePath.toString() val help = optionSet.has(helpArg) val loggingLevel = optionSet.valueOf(loggerLevel) val logToConsole = optionSet.has(logToConsoleArg)