@@ -75,17 +75,19 @@ public static void parseArguments(String[] params)
75
75
throws IllegalOptionValueException , UnknownOptionException {
76
76
CmdLineParser parser = new CmdLineParser ();
77
77
Option pluginDirOption = parser .addStringOption (Configuration .PLUGINS_OPTION );
78
+ Option portOption = parser .addIntegerOption ('p' , Configuration .PORT_KEY );
79
+
78
80
Option loadGameFileOption = parser .addStringOption (Configuration .GAMELOADFILE );
79
81
Option turnToLoadOption = parser .addIntegerOption (Configuration .TURN_TO_LOAD );
80
82
Option saveReplayOption = parser .addBooleanOption (Configuration .SAVE_REPLAY );
81
- Option portOption = parser .addIntegerOption ('p' , Configuration .PORT_KEY );
82
83
parser .parse (params );
83
84
84
- String path = (String ) parser .getOptionValue (pluginDirOption , null );
85
+ String pluginPath = (String ) parser .getOptionValue (pluginDirOption , null );
86
+ String port = parser .getOptionValue (portOption , SharedConfiguration .DEFAULT_PORT ).toString ();
87
+
85
88
String loadGameFile = (String ) parser .getOptionValue (loadGameFileOption , null );
86
89
Integer turnToLoad = (Integer ) parser .getOptionValue (turnToLoadOption , 0 );
87
90
Boolean saveReplay = (Boolean ) parser .getOptionValue (saveReplayOption , false );
88
- String port = parser .getOptionValue (portOption , SharedConfiguration .DEFAULT_PORT ).toString ();
89
91
90
92
Configuration .set (Configuration .PORT_KEY , port );
91
93
if (loadGameFile != null ) {
@@ -97,10 +99,10 @@ public static void parseArguments(String[] params)
97
99
if (saveReplay )
98
100
Configuration .set (Configuration .SAVE_REPLAY , saveReplay .toString ());
99
101
100
- if (path != null ) {
101
- File pluginDir = new File (path ).getAbsoluteFile ();
102
+ if (pluginPath != null ) {
103
+ File pluginDir = new File (pluginPath ).getAbsoluteFile ();
102
104
if (pluginDir .exists () && pluginDir .isDirectory ()) {
103
- Configuration .set (Configuration .PLUGINS_OPTION , path );
105
+ Configuration .set (Configuration .PLUGINS_OPTION , pluginPath );
104
106
logger .info ("Loading plugins from {}" , pluginDir );
105
107
} else {
106
108
logger .warn ("Could not find {} to load plugins from" , pluginDir );
0 commit comments