X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fbin%2Fargparser%2FArgValues.java;h=f25fc9ad0876497c21f86ce411fc64815087b70e;hb=b382fe5af3f138ede6db2ab1efc05ddd0819eea6;hp=f2c299cc253bf976c4c00851854188e05a294c30;hpb=167f4222520be1ec49277dab1e5350d236ed6292;p=jalview.git diff --git a/src/jalview/bin/argparser/ArgValues.java b/src/jalview/bin/argparser/ArgValues.java index f2c299c..f25fc9a 100644 --- a/src/jalview/bin/argparser/ArgValues.java +++ b/src/jalview/bin/argparser/ArgValues.java @@ -8,6 +8,7 @@ import java.util.stream.Collectors; import jalview.bin.Console; import jalview.bin.argparser.Arg.Opt; +import jalview.bin.argparser.Arg.Type; public class ArgValues { @@ -31,6 +32,11 @@ public class ArgValues private Map idMap = new HashMap<>(); + /* + * Type type is only really used by --help-type + */ + private Type type = null; + protected ArgValues(Arg a) { this.arg = a; @@ -53,6 +59,17 @@ public class ArgValues return arg; } + protected void setType(Type t) + { + if (this.arg().hasOption(Opt.HASTYPE)) + this.type = t; + } + + public Type getType() + { + return type; + } + protected int getCount() { return argCount; @@ -76,8 +93,10 @@ public class ArgValues return this.negated; } - protected void setBoolean(boolean b, int i, boolean beingSetByWildcard) + protected void setBoolean(Type t, boolean b, int i, + boolean beingSetByWildcard) { + this.setType(t); // don't overwrite a wildcard set boolean with a non-wildcard set boolean if (boolIndex >= 0 && !this.setByWildcard && beingSetByWildcard) return; @@ -117,15 +136,16 @@ public class ArgValues return sb.toString(); } - protected void addValue(String val, int argIndex, boolean wildcard) + protected void addValue(Type type, String val, int argIndex, + boolean wildcard) { - addArgValue(new ArgValue(arg(), val, argIndex), wildcard); + addArgValue(new ArgValue(arg(), type, val, argIndex), wildcard); } - protected void addValue(SubVals sv, String content, int argIndex, - boolean wildcard) + protected void addValue(SubVals sv, Type type, String content, + int argIndex, boolean wildcard) { - addArgValue(new ArgValue(arg(), sv, content, argIndex), wildcard); + addArgValue(new ArgValue(arg(), sv, type, content, argIndex), wildcard); } protected void addArgValue(ArgValue av, boolean beingSetByWildcard)