Jalview.exit(null, 0);
}
- if (bootstrapArgs.contains(Arg.HEADLESS))
+ // new CLI
+ headlessArg = isHeadless(bootstrapArgs);
+ if (headlessArg)
{
System.setProperty("java.awt.headless", "true");
- // new
- headlessArg = bootstrapArgs.getBoolean(Arg.HEADLESS);
}
+ // old CLI
if (aparser.contains("nodisplay") || aparser.contains("nogui")
|| aparser.contains("headless"))
{
System.setProperty("java.awt.headless", "true");
- // old
headless = true;
}
// anything else!
System.out.println("[TESTOUTPUT] arg "
+ (yes ? a.argString() : a.negateArgString()) + " was set");
}
+
+ private static boolean isHeadless(BootstrapArgs bootstrapArgs)
+ {
+ if (bootstrapArgs == null)
+ {
+ return false;
+ }
+ boolean isHeadless = false;
+ if (bootstrapArgs.contains(Arg.GUI))
+ {
+ isHeadless = !bootstrapArgs.getBoolean(Arg.GUI);
+ }
+ else if (bootstrapArgs.contains(Arg.HEADLESS))
+ {
+ isHeadless = bootstrapArgs.getBoolean(Arg.HEADLESS);
+ }
+ else if (bootstrapArgs.argsHaveOption(Opt.OUTPUTFILE))
+ {
+ isHeadless = true;
+ }
+ return isHeadless;
+ }
}
+ ChannelProperties.getProperty("app_name"),
Opt.UNARY, Opt.BOOTSTRAP),
HEADLESS(Type.CONFIG,
- "Run Jalview in headless mode. No GUI interface will be created and Jalview will quit after all arguments have been processed.",
+ "Run Jalview in headless mode. No GUI interface will be created and Jalview will quit after all arguments have been processed. "
+ + "Headless mode is assumed if an output file is to be generated, this can be overridden with --noheadless or --gui.",
+ Opt.BOOLEAN, Opt.BOOTSTRAP),
+ GUI(Type.CONFIG,
+ "Do not run Jalview in headless mode. This overrides the assumption of headless mode when an output file is to be generated.",
Opt.UNARY, Opt.BOOTSTRAP),
JABAWS(Type.CONFIG, "Set a different URL to connect to a JABAWS server.",
Opt.STRING, Opt.BOOTSTRAP),
"Output an image of the open alignment window. Format is specified by the subval modifier, a following --type argument or guessed from the file extension. Valid formats/extensions are:\n"
+ "svg,\n" + "png,\n" + "eps,\n" + "html,\n" + "biojs.",
Opt.STRING, Opt.LINKED, Opt.ALLOWSUBSTITUTIONS, Opt.ALLOWALL,
- Opt.REQUIREINPUT, Opt.OUTPUT, Opt.PRIMARY),
+ Opt.REQUIREINPUT, Opt.OUTPUTFILE, Opt.PRIMARY),
TYPE(Type.IMAGE,
"Set the image format for the preceding --image. Valid values are:\n"
+ "svg,\n" + "png,\n" + "eps,\n" + "html,\n" + "biojs.",
Opt.STRING, Opt.LINKED, Opt.ALLOWALL),
STRUCTUREIMAGE(Type.STRUCTUREIMAGE,
"Export an image of a 3D structure opened in JMOL", Opt.STRING,
- Opt.LINKED, Opt.MULTI),
+ Opt.LINKED, Opt.MULTI, Opt.OUTPUTFILE),
STRUCTUREIMAGETYPE(Type.STRUCTUREIMAGE,
"Set the structure image format for the preceding --structureimage. Valid values are:\n"
+ "svg,\n" + "png,\n" + "eps,\n" + "html,\n" + "biojs.",
+ "clustal (aln),\n" + "phylip (phy),\n"
+ "jalview (jvp, jar).",
Opt.STRING, Opt.LINKED, Opt.ALLOWSUBSTITUTIONS, Opt.ALLOWALL,
- Opt.REQUIREINPUT, Opt.OUTPUT, Opt.PRIMARY),
+ Opt.REQUIREINPUT, Opt.OUTPUTFILE, Opt.PRIMARY),
FORMAT(Type.OUTPUT,
"Sets the format for the preceding --output file. Valid formats are:\n"
+ "fasta,\n" + "pfam,\n" + "stockholm,\n" + "pir,\n"
INPUT, // This Arg counts as an input for REQUIREINPUT
REQUIREINPUT, // This Arg can only be applied via --all if there is an
// input (i.e. --open or --append)
- OUTPUT, // This Arg provides an output filename. With Opt.ALLOWALL *.ext is
- // shorthand for --all --output={basename}.ext
+ OUTPUTFILE, // This Arg provides an output filename. With Opt.ALLOWALL *.ext
+ // is
+ // shorthand for --all --output={basename}.ext
STORED, // This Arg resets and creates a new set of "opened" linkedIds
HELP, // This Arg is a --help type arg
PRIMARY, // This Arg is the main Arg for its type
return true;
}
+ protected Opt[] getOptions()
+ {
+ return argOptions;
+ }
+
protected void setOptions(Opt... options)
{
this.argOptions = options;