break;
case 'l':
if(args[i].equals("-logfile")
|| args[i].equals("-log")) {
try {
Out.addOutputLogger(new PrintStreamOutputLogger(new PrintStream(new File(args[++i]))));
logLocationSet = true;
} catch (FileNotFoundException e) {
Out.exception(e);
}
continue;
}
break;
case 'n':
if(args[i].equals("-nocli")) {
PluginManager.setEnableCli(false);
continue;
}
if(args[i].equals("-nogui")) {
PluginManager.setEnableGui(false);
continue;
}
break;
case 's':
if(args[i].equals("-stdout")) {
Out.addOutputLogger(new PrintStreamOutputLogger(System.out));
logLocationSet = true;
continue;
}
break;
case 'v':
if(args[i].equals("-v") || args[i].equals("-version")) {
System.out.println(CurrentVersion.version().toString());
System.exit(0);
}
break;
}
}
Out.error(Main.class, "Invalid argument: " + args[i]);
System.exit(1);
}
// Set the default log file
if(CurrentVersion.fromJar()) {
try {
File logFile = new File("log.txt");
// Report errors for nightly builds
if(CurrentVersion.version().getReleaseType().isNightly()
&& logFile.exists()
&& (logFile.length() > 0))
ExceptionReporter.reportErrors(logFile);
if(!logLocationSet)
Out.addOutputLogger(new PrintStreamOutputLogger(new PrintStream(logFile)));
} catch(Exception e) {
Out.popupException(e);
}
} else {
// Running in the debugger
if(!logLocationSet)
Out.addOutputLogger(new PrintStreamOutputLogger(System.out));
}
if(forceConfig) {
try {
new GlobalConfigurationFrame();