if (cliMode) {
// hide splash screen
SplashScreen.getSplashScreen().close();
final CliArguments arguments = _options.getCommandLineArguments();
if (arguments.isUsageMode()) {
final PrintWriter out = new PrintWriter(System.out);
CliArguments.printUsage(out);
exitCommandLine(null, 1);
return;
}
}
// configuration loading can be multithreaded, so begin early
final AnalyzerBeansConfiguration configuration = loadConfiguration();
if (!cliMode) {
// set up error handling that displays an error dialog
final DCUncaughtExceptionHandler exceptionHandler = new DCUncaughtExceptionHandler();
Thread.setDefaultUncaughtExceptionHandler(exceptionHandler);
// init the look and feel
LookAndFeelManager.getInstance().init();
}
// log usage
UsageLogger.getInstance().logApplicationStartup();
if (cliMode) {
final PrintWriter out = new PrintWriter(System.out);
// run in CLI mode
CliArguments arguments = _options.getCommandLineArguments();
final CliRunner runner = new CliRunner(arguments, out);
runner.run(configuration);
out.flush();