import jalview.analysis.AlignmentUtils;
import jalview.api.structures.JalviewStructureDisplayI;
+import jalview.bin.Jalview.ExitCode;
import jalview.bin.argparser.Arg;
import jalview.bin.argparser.ArgParser;
import jalview.bin.argparser.ArgParser.Position;
}
if (argParser.getBoolean(Arg.QUIT))
{
- Jalview.getInstance().quit();
+ Jalview.getInstance().exit(
+ "Exiting due to " + Arg.QUIT.argString() + " argument.",
+ ExitCode.OK);
return true;
}
// carry on with jalview.bin.Jalview
Console.debug(
"Opening '" + openFile + "' in new alignment frame");
FileLoader fileLoader = new FileLoader(!headless);
- boolean xception=false;
- try {
+ boolean xception = false;
+ try
+ {
af = fileLoader.LoadFileWaitTillLoaded(openFile, protocol,
format);
} catch (Throwable thr)
{
- xception=true;
- Console.error("Couldn't open '"+openFile+"' as "+format+" "+thr.getLocalizedMessage()+ " (Enable debug for full stack trace)");
- Console.debug("Exception when opening '"+openFile+"'",thr);
- }
- finally
+ xception = true;
+ Console.error("Couldn't open '" + openFile + "' as " + format
+ + " " + thr.getLocalizedMessage()
+ + " (Enable debug for full stack trace)");
+ Console.debug("Exception when opening '" + openFile + "'", thr);
+ } finally
{
- if (af==null && !xception)
+ if (af == null && !xception)
{
- Console.info("Ignoring '"+openFile+"' - no alignment data found.");
+ Console.info("Ignoring '" + openFile
+ + "' - no alignment data found.");
continue;
}
}
{
if (headless)
{
- Jalview.exit("Could not open any files in headless mode", 1);
+ Jalview.exit("Could not open any files in headless mode",
+ ExitCode.NO_FILES);
}
else
{
Jalview.exit("No valid format specified for "
+ Arg.OUTPUT.argString() + ". Valid formats are "
- + validSB.toString() + ".", 1);
+ + validSB.toString() + ".", ExitCode.INVALID_FORMAT);
// this return really shouldn't happen
return false;
}