From: Ben Soares Date: Thu, 7 Sep 2023 11:01:10 +0000 (+0100) Subject: JAL-629 Change names of Opt.ALLOWALL to Opt.ALLOWMULTIID and Opt.MULTI to Opt.MULTIVA... X-Git-Tag: Release_2_11_3_0~8^2~5^2~36 X-Git-Url: http://source.jalview.org/gitweb/?p=jalview.git;a=commitdiff_plain;h=73e4b463a2257168a1155a96deb0a18a0e4ce162 JAL-629 Change names of Opt.ALLOWALL to Opt.ALLOWMULTIID and Opt.MULTI to Opt.MULTIVALUE. Remove filename value open* as trigger for applying an output file to all globbed files opened in the last --open, and make it the default option for globbed files opened. Adjust 2 test data for removed 'open*'. --- diff --git a/src/jalview/bin/argparser/Arg.java b/src/jalview/bin/argparser/Arg.java index 7882d7b..2bd8e26 100644 --- a/src/jalview/bin/argparser/Arg.java +++ b/src/jalview/bin/argparser/Arg.java @@ -19,7 +19,7 @@ public enum Arg // Initialising arguments (BOOTSTRAP) HELP(Type.HELP, "h", "Display basic help", Opt.UNARY, Opt.BOOTSTRAP, - Opt.HASTYPE, Opt.MULTI), + Opt.HASTYPE, Opt.MULTIVALUE), /* * Other --help-type Args will be added by the static block. */ @@ -62,27 +62,27 @@ public enum Arg Opt.BOOTSTRAP, Opt.SECRET), QUIET(Type.CONFIG, "q", "Stop all output to STDOUT (after the Java Virtual Machine has started). Use ‑‑quiet a second time to stop all output to STDERR.", - Opt.UNARY, Opt.MULTI, Opt.BOOTSTRAP), + Opt.UNARY, Opt.MULTIVALUE, 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. + Opt.MULTIVALUE, Opt.NOACTION, Opt.SECRET), // keep this secret for now. // Opening an alignment OPEN(Type.OPENING, "Opens one or more alignment files or URLs in new alignment windows.", - Opt.STRING, Opt.LINKED, Opt.INCREMENTDEFAULTCOUNTER, Opt.MULTI, + Opt.STRING, Opt.LINKED, Opt.INCREMENTDEFAULTCOUNTER, Opt.MULTIVALUE, Opt.GLOB, Opt.ALLOWSUBSTITUTIONS, Opt.INPUT, Opt.STORED, Opt.PRIMARY), APPEND(Type.OPENING, "Appends one or more alignment files or URLs to the open alignment window (or opens a new alignment if none already open).", - Opt.STRING, Opt.LINKED, Opt.MULTI, Opt.GLOB, + Opt.STRING, Opt.LINKED, Opt.MULTIVALUE, Opt.GLOB, Opt.ALLOWSUBSTITUTIONS, Opt.INPUT, Opt.PRIMARY), TITLE(Type.OPENING, "Specifies the title for the open alignment window as string.", - Opt.STRING, Opt.LINKED), + Opt.STRING, Opt.LINKED, Opt.ALLOWMULTIID), COLOUR(Type.OPENING, "color", // being a bit soft on the Americans! "Applies the colour scheme to the open alignment window. Valid values include:\n" + "clustal,\n" + "blosum62,\n" + "pc-identity,\n" @@ -97,98 +97,103 @@ public enum Arg + "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), + Opt.STRING, Opt.LINKED, Opt.ALLOWMULTIID), FEATURES(Type.OPENING, "Add a feature file or URL to the open alignment.", - Opt.STRING, Opt.LINKED, Opt.MULTI, Opt.ALLOWSUBSTITUTIONS), + Opt.STRING, Opt.LINKED, Opt.MULTIVALUE, Opt.ALLOWSUBSTITUTIONS, + Opt.ALLOWMULTIID), TREE(Type.OPENING, "Add a tree file or URL to the open alignment.", - Opt.STRING, Opt.LINKED, Opt.MULTI, Opt.ALLOWSUBSTITUTIONS), + Opt.STRING, Opt.LINKED, Opt.MULTIVALUE, Opt.ALLOWSUBSTITUTIONS, + Opt.ALLOWMULTIID), SORTBYTREE(Type.OPENING, "Enforces sorting (or not sorting) the open alignment in the order of an attached phylogenetic tree.", - true, Opt.LINKED, Opt.BOOLEAN, Opt.ALLOWALL), + true, Opt.LINKED, Opt.BOOLEAN, Opt.ALLOWMULTIID), ANNOTATIONS(Type.OPENING, "Add an annotations file or URL to the open alignment.", - Opt.STRING, Opt.LINKED, Opt.MULTI, Opt.ALLOWSUBSTITUTIONS), + Opt.STRING, Opt.LINKED, Opt.MULTIVALUE, Opt.ALLOWSUBSTITUTIONS, + Opt.ALLOWMULTIID), SHOWANNOTATIONS(Type.OPENING, "Enforces showing (or not showing) alignment annotations.", - Opt.BOOLEAN, Opt.LINKED, Opt.ALLOWALL), + Opt.BOOLEAN, Opt.LINKED, Opt.ALLOWMULTIID, Opt.ALLOWMULTIID), WRAP(Type.OPENING, "Enforces wrapped (or not wrapped) alignment formatting.", - Opt.BOOLEAN, Opt.LINKED, Opt.ALLOWALL), + Opt.BOOLEAN, Opt.LINKED, Opt.ALLOWMULTIID, Opt.ALLOWMULTIID), NOSTRUCTURE(Type.OPENING, "Do not open or process any 3D structure in the ‑‑open or ‑‑append files.", - Opt.UNARY, Opt.LINKED, Opt.ALLOWALL), + Opt.UNARY, Opt.LINKED, Opt.ALLOWMULTIID, Opt.ALLOWMULTIID), // Adding a 3D structure STRUCTURE(Type.STRUCTURE, "Load a structure file or URL associated with a sequence in the open alignment.\n" + "The sequence to be associated with can be specified with a following --seqid argument, or the subval modifier seqid=ID can be used. A subval INDEX can also be used to specify the INDEX-th sequence in the open alignment.", - Opt.STRING, Opt.LINKED, Opt.MULTI, Opt.ALLOWSUBSTITUTIONS, - Opt.PRIMARY), + Opt.STRING, Opt.LINKED, Opt.MULTIVALUE, Opt.ALLOWSUBSTITUTIONS, + Opt.PRIMARY, Opt.ALLOWMULTIID), SEQID(Type.STRUCTURE, "Specify the sequence name for the preceding --structure to be associated with.", - Opt.STRING, Opt.LINKED, Opt.MULTI, Opt.ALLOWSUBSTITUTIONS), + Opt.STRING, Opt.LINKED, Opt.MULTIVALUE, Opt.ALLOWSUBSTITUTIONS, + Opt.ALLOWMULTIID), PAEMATRIX(Type.STRUCTURE, "Add a PAE json matrix file to the preceding --structure.", - Opt.STRING, Opt.LINKED, Opt.MULTI, Opt.ALLOWSUBSTITUTIONS), + Opt.STRING, Opt.LINKED, Opt.MULTIVALUE, Opt.ALLOWSUBSTITUTIONS, + Opt.ALLOWMULTIID), TEMPFAC(Type.STRUCTURE, "Set the type of temperature factor. Possible values are:\n" + "default,\n" + "plddt.", - Opt.STRING, Opt.LINKED), + Opt.STRING, Opt.LINKED, Opt.ALLOWMULTIID), STRUCTUREVIEWER(Type.STRUCTURE, "Set the structure viewer to use to open the 3D structure file specified in previous --structure to name. Possible values of name are:\n" + "none,\n" + "jmol,\n" + "chimera,\n" + "chimerax,\n" + "pymol.", - Opt.STRING, Opt.LINKED, Opt.MULTI), + Opt.STRING, Opt.LINKED, Opt.MULTIVALUE, Opt.ALLOWMULTIID), NOTEMPFAC(Type.STRUCTURE, "Do not show the temperature factor annotation for the preceding --structure.", - Opt.UNARY, Opt.LINKED, Opt.ALLOWALL, Opt.SECRET), // keep this secret + Opt.UNARY, Opt.LINKED, Opt.ALLOWMULTIID, Opt.SECRET), // keep this secret // until it works! SHOWSSANNOTATIONS(Type.STRUCTURE, null, Opt.BOOLEAN, Opt.LINKED, - Opt.ALLOWALL), + Opt.ALLOWMULTIID), // Outputting files IMAGE(Type.IMAGE, "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.STRING, Opt.LINKED, Opt.ALLOWSUBSTITUTIONS, Opt.ALLOWMULTIID, 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), + Opt.STRING, Opt.LINKED, Opt.ALLOWMULTIID), TEXTRENDERER(Type.IMAGE, "Sets whether text in a vector image format (SVG, HTML, EPS) should be rendered as text or vector line-art. Possible values are:\n" + "text,\n" + "lineart.", - Opt.STRING, Opt.LINKED, Opt.ALLOWALL), + Opt.STRING, Opt.LINKED, Opt.ALLOWMULTIID), SCALE(Type.IMAGE, "Sets a scaling for bitmap image format (PNG). Should be given as a floating point number. If used in conjunction with --width and --height then the smallest scaling will be used (scale, width and height provide bounds for the image).", - Opt.STRING, Opt.LINKED, Opt.ALLOWALL), + Opt.STRING, Opt.LINKED, Opt.ALLOWMULTIID), WIDTH(Type.IMAGE, "Sets a width for bitmap image format (PNG) with the height maintaining the aspect ratio. Should be given as a positive integer. If used in conjunction with --scale and --height then the smallest scaling will be used (scale, width and height provide bounds for the image).", - Opt.STRING, Opt.LINKED, Opt.ALLOWALL), + Opt.STRING, Opt.LINKED, Opt.ALLOWMULTIID), HEIGHT(Type.IMAGE, "Sets a height for bitmap image format (PNG) with the width maintaining the aspect ratio. Should be given as a positive integer. If used in conjunction with --scale and --width then the smallest scaling will be used (scale, width and height provide bounds for the image).", - Opt.STRING, Opt.LINKED, Opt.ALLOWALL), + Opt.STRING, Opt.LINKED, Opt.ALLOWMULTIID), STRUCTUREIMAGE(Type.STRUCTUREIMAGE, "Export an image of a 3D structure opened in JMOL", Opt.STRING, - Opt.LINKED, Opt.MULTI, Opt.OUTPUTFILE), + Opt.LINKED, Opt.MULTIVALUE, Opt.OUTPUTFILE, Opt.ALLOWMULTIID), 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.", - Opt.STRING, Opt.LINKED, Opt.ALLOWALL), + Opt.STRING, Opt.LINKED, Opt.ALLOWMULTIID), STRUCTUREIMAGETEXTRENDERER(Type.STRUCTUREIMAGE, "Sets whether text in a vector structure image format (SVG, EPS) should be rendered as text or vector line-art. Possible values are:\n" + "text,\n" + "lineart.", - Opt.STRING, Opt.LINKED, Opt.ALLOWALL), + Opt.STRING, Opt.LINKED, Opt.ALLOWMULTIID), STRUCTUREIMAGESCALE(Type.STRUCTUREIMAGE, "Sets a scaling for bitmap structure image format (PNG). Should be given as a floating point number. If used in conjunction with --structureimagewidth and --structureimageheight then the smallest scaling will be used (structureimagescale, structureimagewidth and structureimageheight provide bounds for the structure image).", - Opt.STRING, Opt.LINKED, Opt.ALLOWALL), + Opt.STRING, Opt.LINKED, Opt.ALLOWMULTIID), STRUCTUREIMAGEWIDTH(Type.STRUCTUREIMAGE, "Sets a width for bitmap structure image format (PNG) with the height maintaining the aspect ratio. Should be given as a positive integer. If used in conjunction with --structureimagescale and --structureimageheight then the smallest scaling will be used (structureimagescale, structureimagewidth and structureimageheight provide bounds for the structure image).", - Opt.STRING, Opt.LINKED, Opt.ALLOWALL), + Opt.STRING, Opt.LINKED, Opt.ALLOWMULTIID), STRUCTUREIMAGEHEIGHT(Type.STRUCTUREIMAGE, "Sets a height for bitmap structure image format (PNG) with the width maintaining the aspect ratio. Should be given as a positive integer. If used in conjunction with --structureimagescale and --structureimagewidth then the smallest scaling will be used (structureimagescale, structureimagewidth and structureimageheight provide bounds for the structure image).", - Opt.STRING, Opt.LINKED, Opt.ALLOWALL), + Opt.STRING, Opt.LINKED, Opt.ALLOWMULTIID), OUTPUT(Type.OUTPUT, "Export the open alignment to file filename. The format name is specified by the subval modifier format=name, a following --format name argument or guessed from the file extension. Valid format names (and file extensions) are:\n" @@ -198,32 +203,32 @@ public enum Arg + "pileup (pileup),\n" + "msf (msf),\n" + "clustal (aln),\n" + "phylip (phy),\n" + "jalview (jvp, jar).", - Opt.STRING, Opt.LINKED, Opt.ALLOWSUBSTITUTIONS, Opt.ALLOWALL, + Opt.STRING, Opt.LINKED, Opt.ALLOWSUBSTITUTIONS, Opt.ALLOWMULTIID, 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" + "blc,\n" + "amsa,\n" + "json,\n" + "pileup,\n" + "msf,\n" + "clustal,\n" + "phylip,\n" + "jalview.", - Opt.STRING, Opt.LINKED, Opt.ALLOWALL), + Opt.STRING, Opt.LINKED, Opt.ALLOWMULTIID), GROOVY(Type.PROCESS, "Process a groovy script in the file for the open alignment.", - Opt.STRING, Opt.LINKED, Opt.MULTI, Opt.ALLOWSUBSTITUTIONS, - Opt.ALLOWALL), + Opt.STRING, Opt.LINKED, Opt.MULTIVALUE, Opt.ALLOWSUBSTITUTIONS, + Opt.ALLOWMULTIID), BACKUPS(Type.OUTPUT, "Enable (or disable) writing backup files when saving an ‑‑output file. This applies to the current open alignment. To apply to all ‑‑output and ‑‑image files, use after ‑‑all.", - true, Opt.BOOLEAN, Opt.LINKED, Opt.ALLOWALL), + true, Opt.BOOLEAN, Opt.LINKED, Opt.ALLOWMULTIID), OVERWRITE(Type.OUTPUT, "Enable (or disable) overwriting of output files without backups enabled. This applies to the current open alignment. To apply to all ‑‑output and ‑‑image files, use after ‑‑all.", - Opt.BOOLEAN, Opt.LINKED, Opt.ALLOWALL), + Opt.BOOLEAN, Opt.LINKED, Opt.ALLOWMULTIID), CLOSE(Type.OPENING, "Close the current open alignment window. This occurs after other output arguments. This applies to the current open alignment. To apply to all ‑‑output and ‑‑image files, use after ‑‑all.", - Opt.UNARY, Opt.LINKED, Opt.ALLOWALL), + Opt.UNARY, Opt.LINKED, Opt.ALLOWMULTIID), // controlling flow of arguments NEW(Type.FLOW, "Move on to a new alignment window. This will ensure --append will start a new alignment window and other linked arguments will apply to the new alignment window.", - Opt.UNARY, Opt.MULTI, Opt.NOACTION, Opt.INCREMENTDEFAULTCOUNTER), + Opt.UNARY, Opt.MULTIVALUE, Opt.NOACTION, Opt.INCREMENTDEFAULTCOUNTER), SUBSTITUTIONS(Type.FLOW, "The following argument values allow (or don't allow) subsituting filename parts. This is initially true. Valid substitutions are:\n" + "{basename} - the filename-without-extension of the currently --opened file (or first --appended file),\n" @@ -233,22 +238,22 @@ public enum Arg + "{n} - the value of the index counter (starting at 0).\n" + "{++n} - increase and substitute the value of the index counter,\n" + "{} - the value of the current alignment window default index.", - true, Opt.BOOLEAN, Opt.MULTI, Opt.NOACTION), + true, Opt.BOOLEAN, Opt.MULTIVALUE, Opt.NOACTION), ARGFILE(Type.FLOW, "Open one or more files filename and read, line-by-line, as arguments to Jalview.\n" + "Values in an argfile should be given with an equals sign (\"=\") separator with no spaces.\n" + "Note that if you use one or more --argfile arguments then all other non-initialising arguments will be ignored.", - Opt.STRING, Opt.MULTI, Opt.BOOTSTRAP, Opt.GLOB, + Opt.STRING, Opt.MULTIVALUE, Opt.BOOTSTRAP, Opt.GLOB, Opt.ALLOWSUBSTITUTIONS), NPP(Type.FLOW, "n++", "Increase the index counter used in argument value substitutions.", - Opt.UNARY, Opt.MULTI, Opt.NOACTION), + Opt.UNARY, Opt.MULTIVALUE, Opt.NOACTION), ALL(Type.FLOW, "Apply the following output arguments to all sets of linked arguments.", - Opt.BOOLEAN, Opt.MULTI, Opt.NOACTION), + Opt.BOOLEAN, Opt.MULTIVALUE, Opt.NOACTION), OPENED(Type.FLOW, "Apply the following output arguments to all of the last --open'ed set of linked arguments.", - Opt.BOOLEAN, Opt.MULTI, Opt.NOACTION), + Opt.BOOLEAN, Opt.MULTIVALUE, Opt.NOACTION), QUIT(Type.FLOW, "After all files have been opened, appended and output, quit Jalview. In ‑‑headless mode this already happens.", Opt.UNARY), @@ -257,26 +262,26 @@ public enum Arg Opt.UNARY, Opt.SECRET), ALLSTRUCTURES(Type.FLOW, "Apply the following 3D structure formatting arguments to all structures within the open alignment.", - Opt.BOOLEAN, Opt.MULTI, Opt.NOACTION), + Opt.BOOLEAN, Opt.MULTIVALUE, Opt.NOACTION), // secret options TESTOUTPUT(Type.CONFIG, "Allow specific stdout information. For testing purposes only.", Opt.UNARY, Opt.BOOTSTRAP, Opt.SECRET), // do not show this to the user SETPROP(Type.CONFIG, "Set an individual Java System property.", - Opt.STRING, Opt.MULTI, Opt.BOOTSTRAP, Opt.SECRET), // not in use yet + Opt.STRING, Opt.MULTIVALUE, Opt.BOOTSTRAP, Opt.SECRET), // not in use yet NIL(Type.FLOW, "This argument does nothing on its own, but can be used with linkedIds.", - Opt.UNARY, Opt.LINKED, Opt.MULTI, Opt.NOACTION, Opt.SECRET), + Opt.UNARY, Opt.LINKED, Opt.MULTIVALUE, Opt.NOACTION, Opt.SECRET), // private options (inserted during arg processing) SETARGFILE(Type.FLOW, "Sets the current value of the argfilename. Inserted before argfilecontents.", - Opt.UNARY, Opt.LINKED, Opt.STRING, Opt.MULTI, Opt.PRIVATE, + Opt.UNARY, Opt.LINKED, Opt.STRING, Opt.MULTIVALUE, Opt.PRIVATE, Opt.NOACTION), UNSETARGFILE(Type.FLOW, "Unsets the current value of the argfilename. Inserted after argfile contents.", - Opt.UNARY, Opt.LINKED, Opt.MULTI, Opt.PRIVATE, Opt.NOACTION), + Opt.UNARY, Opt.LINKED, Opt.MULTIVALUE, Opt.PRIVATE, Opt.NOACTION), // these last two have no purpose in the normal Jalview application but are // used by jalview.bin.Launcher to set memory settings. They are not used by @@ -315,7 +320,7 @@ public enum Arg * A MULTI Arg can be specified multiple times. * Multiple values are stored in the ArgValuesMap (along with their positional index) for each linkedId. */ - MULTI("can be specified multiple times"), + MULTIVALUE("can be specified multiple times"), /* * A Linked Arg can be linked to others through a --arg[linkedId] or --arg[linkedId]=value. * If no linkedId is specified then the current default linkedId will be used. @@ -362,7 +367,7 @@ public enum Arg /* * An ALLOWALL Arg can use the '*' linkedId to apply to all known linkedIds */ - ALLOWALL("can be used with " + ArgParser.DOUBLEDASH + "all"), + ALLOWMULTIID("can be used with " + ArgParser.DOUBLEDASH + "all"), /* * If an Arg has the INCREMENTDEFAULTCOUNTER option and the default linkedId is used, * the defaultLinkedIdCounter is incremented *first*. diff --git a/src/jalview/bin/argparser/ArgParser.java b/src/jalview/bin/argparser/ArgParser.java index 3862375..947a49e 100644 --- a/src/jalview/bin/argparser/ArgParser.java +++ b/src/jalview/bin/argparser/ArgParser.java @@ -150,12 +150,6 @@ public class ArgParser private boolean allLinkedIds = false; /** - * flag to say whether the default linkedId is the current default linked id - * or OPENED linkedIds - */ - private boolean openedLinkedIds = false; - - /** * flag to say whether the structure arguments should be applied to all * structures with this linked id */ @@ -484,12 +478,6 @@ public class ArgParser else if (a == Arg.ALL) { allLinkedIds = !negated; - openedLinkedIds = false; - } - else if (a == Arg.OPENED) - { - openedLinkedIds = !negated; - allLinkedIds = false; } else if (a == Arg.ALLSTRUCTURES) { @@ -516,35 +504,23 @@ public class ArgParser { if (linkedId == null) { - if (a.hasOption(Opt.OUTPUTFILE) && a.hasOption(Opt.ALLOWALL) + if (a.hasOption(Opt.OUTPUTFILE) && a.hasOption(Opt.ALLOWMULTIID) && val.startsWith(MATCHALLLINKEDIDS)) { // --output=*.ext is shorthand for --all --output {basename}.ext // (or --image=*.ext) allLinkedIds = true; - openedLinkedIds = false; linkedId = MATCHALLLINKEDIDS; val = LINKEDIDDIRNAME + File.separator + LINKEDIDBASENAME + val.substring(MATCHALLLINKEDIDS.length()); } - else if (a.hasOption(Opt.OUTPUTFILE) - && a.hasOption(Opt.ALLOWALL) - && val.startsWith(MATCHOPENEDLINKEDIDS)) - { - // --output=open*.ext is shorthand for --opened --output - // {basename}.ext - // (or --image=open*.ext) - openedLinkedIds = true; - allLinkedIds = false; - linkedId = MATCHOPENEDLINKEDIDS; - val = LINKEDIDDIRNAME + File.separator + LINKEDIDBASENAME - + val.substring(MATCHOPENEDLINKEDIDS.length()); - } - else if (allLinkedIds && a.hasOption(Opt.ALLOWALL)) + else if (allLinkedIds && a.hasOption(Opt.ALLOWMULTIID)) { linkedId = MATCHALLLINKEDIDS; } - else if (openedLinkedIds && a.hasOption(Opt.ALLOWALL)) + else if (a.hasOption(Opt.ALLOWMULTIID) + && this.storedLinkedIds != null + && this.storedLinkedIds.size() > 0) { linkedId = MATCHOPENEDLINKEDIDS; } @@ -668,9 +644,8 @@ public class ArgParser // remove the '*' or 'open*' linkedId that should be empty if it was // created if ((MATCHALLLINKEDIDS.equals(linkedId) + || MATCHOPENEDLINKEDIDS.equals(linkedId)) && linkedArgs.containsKey(linkedId)) - || (MATCHOPENEDLINKEDIDS.equals(linkedId) - && linkedArgs.containsKey(linkedId))) { linkedArgs.remove(linkedId); } @@ -1202,7 +1177,7 @@ public class ArgParser Arg a = avs.arg(); List wildcardLinkedIds = null; - if (a.hasOption(Opt.ALLOWALL)) + if (a.hasOption(Opt.ALLOWMULTIID)) { switch (linkedId) { @@ -1233,7 +1208,9 @@ public class ArgParser // skip incorrectly stored wildcard ids! if (id == null || MATCHALLLINKEDIDS.equals(id) || MATCHOPENEDLINKEDIDS.equals(id)) + { continue; + } ArgValuesMap avm = linkedArgs.get(id); // don't set an output if there isn't an input if (a.hasOption(Opt.REQUIREINPUT) diff --git a/src/jalview/bin/argparser/ArgValues.java b/src/jalview/bin/argparser/ArgValues.java index f25fc9a..2b9061c 100644 --- a/src/jalview/bin/argparser/ArgValues.java +++ b/src/jalview/bin/argparser/ArgValues.java @@ -151,9 +151,9 @@ public class ArgValues protected void addArgValue(ArgValue av, boolean beingSetByWildcard) { // allow a non-wildcard value to overwrite a wildcard set single value - boolean overwrite = !arg.hasOption(Opt.MULTI) && setByWildcard + boolean overwrite = !arg.hasOption(Opt.MULTIVALUE) && setByWildcard && !beingSetByWildcard; - if ((!arg.hasOption(Opt.MULTI) && argValueList.size() > 0) + if ((!arg.hasOption(Opt.MULTIVALUE) && argValueList.size() > 0) && !overwrite) return; if (arg.hasOption(Opt.NODUPLICATEVALUES) @@ -182,7 +182,7 @@ public class ArgValues protected ArgValue getArgValue() { - if (arg.hasOption(Opt.MULTI)) + if (arg.hasOption(Opt.MULTIVALUE)) Console.warn("Requesting single value for multi value argument"); return argValueList.size() > 0 ? argValueList.get(0) : null; } diff --git a/src/jalview/bin/argparser/BootstrapArgs.java b/src/jalview/bin/argparser/BootstrapArgs.java index ec62bcd..d32a5b2 100644 --- a/src/jalview/bin/argparser/BootstrapArgs.java +++ b/src/jalview/bin/argparser/BootstrapArgs.java @@ -292,7 +292,7 @@ public class BootstrapArgs private void add(Arg a, Type t, String s) { List> l = getOrCreateList(a); - if (a.hasOption(Opt.MULTI) || l.size() == 0) + if (a.hasOption(Opt.MULTIVALUE) || l.size() == 0) { l.add(entry(t, s)); } @@ -301,7 +301,7 @@ public class BootstrapArgs private void addAll(Arg a, Type t, List al) { List> l = getOrCreateList(a); - if (a.hasOption(Opt.MULTI)) + if (a.hasOption(Opt.MULTIVALUE)) { for (String s : al) {