// old ArgsParser
ArgsParser aparser = new ArgsParser(args);
- // new ArgParser
- ArgParser argparser = new ArgParser(args);
boolean headless = false;
+ try
+ {
+ Console.initLogger();
+ } catch (NoClassDefFoundError error)
+ {
+ error.printStackTrace();
+ System.out.println("\nEssential logging libraries not found."
+ + "\nUse: java -classpath \"$PATH_TO_LIB$/*:$PATH_TO_CLASSES$\" jalview.bin.Jalview");
+ System.exit(0);
+ }
+
String usrPropsFile = aparser.getValue("props");
Cache.loadProperties(usrPropsFile); // must do this before
if (usrPropsFile != null)
"CMD [-props " + usrPropsFile + "] executed successfully!");
}
+ // 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);
+ }
+
if (!Platform.isJS())
/**
* Java only
System.setProperty("http.agent",
"Jalview Desktop/" + Cache.getDefault("VERSION", "Unknown"));
- try
- {
- Console.initLogger();
- } catch (NoClassDefFoundError error)
- {
- error.printStackTrace();
- System.out.println("\nEssential logging libraries not found."
- + "\nUse: java -classpath \"$PATH_TO_LIB$/*:$PATH_TO_CLASSES$\" jalview.bin.Jalview");
- System.exit(0);
- }
-
desktop = null;
setLookAndFeel();
}.start();
}
- if (argparser.isSet(Arg.HEADLESS))
- headless = argparser.getBool(Arg.HEADLESS);
- if (Commands.processArgs(argparser, headless))
- {
- System.exit(1);
- }
-
String file = null, data = null;
FileFormatI format = null;
DataSourceType protocol = null;