private Map<String, AlignFrame> afMap;
- public static void processArgs(ArgParser ap, boolean h)
+ public static boolean processArgs(ArgParser ap, boolean h)
{
argParser = ap;
headless = h;
-
+ boolean argsWereParsed = false;
if (headless)
{
System.setProperty("java.awt.headless", "true");
cmds.processLinked(id);
}
cmds.processImages(id);
+ argsWereParsed |= cmds.wereParsed();
}
}
if (argParser.getBool(Arg.QUIT))
{
Jalview.getInstance().quit();
- // Desktop.instance.quit();
+ return true;
}
+ // carry on with jalview.bin.Jalview
+ return argsWereParsed;
+ }
+
+ boolean argsWereParsed = false;
+
+ private boolean wereParsed()
+ {
+ return argsWereParsed;
}
public Commands()
Console.error("Could not open any files in headless mode");
System.exit(1);
}
- }
- else
- {
- Console.warn("No more files to open");
- if (desktop != null)
- desktop.setProgressBar(null, progress);
+ // TOREMOVE COMMENT
+ // @Ben assumed this was the GUI version of above, rather then the
+ // first==false state
+ else
+ {
+ Console.warn("No more files to open");
+ if (desktop != null)
+ desktop.setProgressBar(null, progress);
+ }
}
}
if (argparser.isSet(Arg.HEADLESS))
headless = argparser.getBool(Arg.HEADLESS);
- Commands.processArgs(argparser, headless);
+ if (Commands.processArgs(argparser, headless))
+ {
+ System.exit(1);
+ }
String file = null, data = null;
FileFormatI format = null;