+ // set log level from cache properties
+ Console.setLogLevel(Cache.getDefault(Cache.JALVIEWLOGLEVEL, "INFO"));
+
+ // new ArgParser
+ ArgParser argparser = new ArgParser(args); // do this after
+ // Console.initLogger, but TODO
+ // want --props before then
+ // CATCH22
+
+ if (argparser.isSet(Arg.HEADLESS))
+ headless = argparser.getBool(Arg.HEADLESS);
+ boolean commandsSuccess = Commands.processArgs(argparser, headless);
+ if (commandsSuccess)
+ {
+ Console.info("Successfully completed commands");
+ if (headless)
+ System.exit(0);
+ }
+ else
+ {
+ Console.warn("Error when running commands");
+ if (headless)
+ System.exit(1);
+ }
+