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;
}
// report errors
- StringBuilder sb = new StringBuilder();
- for (String error : errors)
- {
- sb.append("- " + error);
- sb.append("\n");
- }
- if (Platform.isHeadless())
- {
- Console.debug("All errors from command line argument commands:\n"
- + sb.toString());
- }
- else
- {
- // scrollable dialog box
-
- }
+ Console.debug("All errors from command line argument commands:\n"
+ + errorsToString());
+ // gui errors reported in Jalview
if (argParser.getBoolean(Arg.QUIT))
{
- Jalview.exit("Exiting due to " + Arg.QUIT.argString(), 0);
+ Jalview.getInstance().exit(
+ "Exiting due to " + Arg.QUIT.argString() + " argument.",
+ ExitCode.OK);
return true;
}
// carry on with jalview.bin.Jalview
{
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
{
return whatNext.OKAY;
}
+
+ public List<String> getErrors()
+ {
+ return errors;
+ }
+
+ public String errorsToString()
+ {
+ StringBuilder sb = new StringBuilder();
+ for (String error : errors)
+ {
+ sb.append("- " + error);
+ sb.append("\n");
+ }
+ return sb.toString();
+ }
}