Skip to content

Commit 7f3bf09

Browse files
committed
Move runShell call within null check. Use PropertiesConfiguration as type parameter.
Signed-off-by: Ville Ranta-aho <ville@ville-pekka.com>
1 parent 030fe7d commit 7f3bf09

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

command/src/com/mirth/connect/cli/CommandLineInterface.java

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ private void run(String[] args) {
153153
// Read data from this file
154154
File propertiesFile = new File(line.getOptionValue("c", "conf" + File.separator + "mirth-cli-config.properties"));
155155

156-
FileBasedConfigurationBuilder<FileBasedConfiguration> builder =
157-
new FileBasedConfigurationBuilder<FileBasedConfiguration>(PropertiesConfiguration.class)
156+
FileBasedConfigurationBuilder<PropertiesConfiguration> builder =
157+
new FileBasedConfigurationBuilder<PropertiesConfiguration>(PropertiesConfiguration.class)
158158
.configure(params.fileBased()
159159
.setFile(propertiesFile));
160160
Configuration config = null;
@@ -178,13 +178,15 @@ private void run(String[] args) {
178178
String user = line.getOptionValue("u", config.getString("user"));
179179
String password = line.getOptionValue("p", config.getString("password"));
180180
String script = line.getOptionValue("s", config.getString("script"));
181-
}
182-
if ((server != null) && (user != null) && (password != null)) {
183-
runShell(server, user, password, script, line.hasOption("d"));
184-
} else {
185-
new HelpFormatter().printHelp("Shell", options);
186-
error("all of address, user, password, and version options must be supplied as arguments or in the default configuration file", null);
187-
System.exit(2);
181+
182+
if ((server != null) && (user != null) && (password != null)) {
183+
runShell(server, user, password, script, line.hasOption("d"));
184+
} else {
185+
new HelpFormatter().printHelp("Shell", options);
186+
error("all of address, user, password, and version options must be supplied as arguments or in the default configuration file", null);
187+
System.exit(2);
188+
}
189+
188190
}
189191
} catch (ParseException e) {
190192
error("Could not parse input arguments.", e);

0 commit comments

Comments
 (0)