Now allows a leading - character for command-line arguments. The presence or absence of this character a has not effect.
This commit is contained in:
@@ -4,12 +4,13 @@ public class ArgParser {
|
||||
public static ParsedArgs parse(String[] cmdLineArgs) {
|
||||
ParsedArgs parsedArgs = new ParsedArgs();
|
||||
for (int i = 0; i < cmdLineArgs.length; i++) {
|
||||
if (cmdLineArgs[i].toUpperCase().startsWith("COM=")) {
|
||||
String arg = cmdLineArgs[i].replaceAll("-","");
|
||||
if (arg.toUpperCase().startsWith("COM=")) {
|
||||
String comPlayer = cmdLineArgs[i].split("=")[1];
|
||||
parsedArgs.setComPlayer(comPlayer);
|
||||
System.out.println("ComPlayer set to: " + comPlayer);
|
||||
} else {
|
||||
System.out.println("Ignoring unrecognized argument: " + cmdLineArgs[i]);
|
||||
System.out.println("Ignoring unrecognized argument: " + arg);
|
||||
}
|
||||
}
|
||||
return parsedArgs;
|
||||
|
||||
Reference in New Issue
Block a user