String commandLine = System.getProperty("sun.java.command");
OptionParser optionparser = new OptionParser();
optionparser.allowsUnrecognizedOptions();
ArgumentAcceptingOptionSpec<String> testOption = optionparser.accepts("test").withRequiredArg();
OptionSpecBuilder quitOption = optionparser.accepts("quit");
OptionSet optionset = optionparser.parse(commandLine.split(" "));
testFile = optionset.valueOf(testOption);
quitAfterRun = optionset.has(quitOption);