X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fbin%2Fargparser%2FArg.java;h=2f259786a0216cc55fcfaebbd60df788cd25e83b;hb=14d26b884637cc550dcf383c5098a1142f7c8958;hp=6c97ebc01102a476f9e3fd4c36da75b4b2fd6e3f;hpb=e134764b7eec841cb56a417250f2dd898680f985;p=jalview.git diff --git a/src/jalview/bin/argparser/Arg.java b/src/jalview/bin/argparser/Arg.java index 6c97ebc..2f25978 100644 --- a/src/jalview/bin/argparser/Arg.java +++ b/src/jalview/bin/argparser/Arg.java @@ -44,9 +44,10 @@ public enum Arg 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), @@ -65,6 +66,9 @@ public enum Arg 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, @@ -80,7 +84,7 @@ public enum Arg "Specifies the title for the open alignment window as string.", Opt.STRING, Opt.LINKED), COLOUR(Type.OPENING, "color", // being a bit soft on the Americans! - "Applies the colour scheme to the open alignment window. Valid values are:\n" + "Applies the colour scheme to the open alignment window. Valid values include:\n" + "clustal,\n" + "blosum62,\n" + "pc-identity,\n" + "zappo,\n" + "taylor,\n" + "gecos-flower,\n" + "gecos-blossom,\n" + "gecos-sunset,\n" @@ -89,7 +93,11 @@ public enum Arg + "turn-propensity,\n" + "buried-index,\n" + "nucleotide,\n" + "nucleotide-ambiguity,\n" + "purine-pyrimidine,\n" + "rna-helices,\n" - + "t-coffee-scores,\n" + "sequence-id.", + + "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\"", 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), @@ -374,7 +382,7 @@ public enum Arg * An OUTPUTFILE Arg provides an output filename. With Opt.ALLOWALL *.ext is shorthand for * --all --output={basename}.ext */ - OUTPUTFILE("value is an output file"), + OUTPUTFILE("output file --headless will be assumed unless --gui used"), /* * A STORED Arg resets and creates a new set of "opened" linkedIds */ @@ -399,6 +407,14 @@ public enum Arg * 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), // ; @@ -486,15 +502,15 @@ public enum Arg 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() @@ -544,7 +560,9 @@ public enum Arg 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 @@ -794,7 +812,16 @@ public enum Arg 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(); }