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. "
- + "Headless mode is assumed if an output file is to be generated, this can be overridden with --noheadless or --gui.",
- Opt.BOOLEAN, Opt.BOOTSTRAP),
+ + "Headless mode is assumed if an output file is to be generated, this can be overridden with --gui.",
+ Opt.UNARY, 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),
QUESTIONNAIRE(Type.CONFIG,
"Show (or don't show) the questionnaire if one is available.",
true, Opt.BOOLEAN, Opt.BOOTSTRAP),
- USAGESTATS(Type.CONFIG,
- "Send (or don't send) initial launch usage stats.", true,
- Opt.BOOLEAN, Opt.BOOTSTRAP),
+ NOUSAGESTATS(Type.CONFIG, "Don't send initial launch usage stats.",
+ Opt.UNARY, Opt.BOOTSTRAP),
+ NOSTARTUPFILE(Type.CONFIG, "Don't show the default startup file.",
+ Opt.UNARY, Opt.BOOTSTRAP),
WEBSERVICEDISCOVERY(Type.CONFIG,
"Attempt (or don't attempt) to connect to JABAWS web services.",
true, Opt.BOOLEAN, Opt.BOOTSTRAP),
INITSUBSTITUTIONS(Type.CONFIG,
"Set ‑‑substitutions to be initially enabled (or initially disabled).",
true, Opt.BOOLEAN, Opt.BOOTSTRAP, Opt.NOACTION, Opt.SECRET),
+ P(Type.CONFIG, "Set a Jalview preference value for this session.",
+ Opt.PREFIXKEV, Opt.PRESERVECASE, Opt.STRING, Opt.BOOTSTRAP,
+ Opt.MULTI, Opt.NOACTION, Opt.SECRET), // keep this secret for now.
// Opening an alignment
OPEN(Type.OPENING,
+ "turn-propensity,\n" + "buried-index,\n"
+ "nucleotide,\n" + "nucleotide-ambiguity,\n"
+ "purine-pyrimidine,\n" + "rna-helices,\n"
- + "t-coffee-scores,\n" + "sequence-id.\n"
- +"\n"
+ + "t-coffee-scores,\n" + "sequence-id.\n" + "\n"
+ "Names of user defined colourschemes will also work,\n"
- +"and jalview colourscheme specifications like\n"
- +"--colour=\"D,E=red; K,R,H=0022FF; C,c=yellow\"",
+ + "and jalview colourscheme specifications like\n"
+ + "--colour=\"D,E=red; K,R,H=0022FF; C,c=yellow\"",
Opt.STRING, Opt.LINKED, Opt.ALLOWALL),
FEATURES(Type.OPENING, "Add a feature file or URL to the open alignment.",
Opt.STRING, Opt.LINKED, Opt.MULTI, Opt.ALLOWSUBSTITUTIONS),
+ "clustal (aln),\n" + "phylip (phy),\n"
+ "jalview (jvp, jar).",
Opt.STRING, Opt.LINKED, Opt.ALLOWSUBSTITUTIONS, Opt.ALLOWALL,
- Opt.REQUIREINPUT, Opt.OUTPUTFILE, Opt.PRIMARY),
+ Opt.REQUIREINPUT, Opt.OUTPUTFILE, Opt.STDOUT, 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"
*/
OUTPUTFILE("output file --headless will be assumed unless --gui used"),
/*
+ * A STDOUT Arg can take an output filename that can be '-' to mean print to STDOUT.
+ */
+ STDOUT("allows the output filename '" + ArgParser.STDOUTFILENAME
+ + "' to mean output to STDOUT"),
+ /*
* A STORED Arg resets and creates a new set of "opened" linkedIds
*/
STORED(null),
* A LAST arg gets moved to appear last in the usage statement (within type)
*/
LAST(null),
+ /*
+ * After other args are checked, the following args can prefix a KEY=VALUE argument
+ */
+ PREFIXKEV("prefixes key=value"),
+ /*
+ * do not lowercase the name when getting the arg name or arg string
+ */
+ PRESERVECASE(null),
//
;
private Arg(Type type, String alternativeName, String description,
boolean defaultBoolean, Opt... options)
{
+ this.type = type;
+ this.description = description;
+ this.defaultBoolValue = defaultBoolean;
+ this.setOptions(options);
this.argNames = alternativeName != null
? new String[]
{ this.getName(), alternativeName }
: new String[]
{ this.getName() };
- this.type = type;
- this.description = description;
- this.defaultBoolValue = defaultBoolean;
- this.setOptions(options);
}
public String argString()
public String getName()
{
- return this.name().toLowerCase(Locale.ROOT).replace('_', '-');
+ String name = hasOption(Opt.PRESERVECASE) ? this.name()
+ : this.name().toLowerCase(Locale.ROOT);
+ return name.replace('_', '-');
}
@Override
argSb.append(
a.hasOption(Opt.BOOLEAN) ? booleanArgString(a) : a.argString());
if (a.hasOption(Opt.STRING))
- argSb.append("=value");
+ {
+ if (a.hasOption(Opt.PREFIXKEV))
+ {
+ argSb.append("key=value");
+ }
+ else
+ {
+ argSb.append("=value");
+ }
+ }
return argSb.toString();
}