+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
package jalview.bin.argparser;
import java.util.ArrayList;
private boolean setByWildcard = false;
+ private String givenLinkedId = null;
+
private int boolIndex = -1;
private List<Integer> argsIndexes;
private Map<String, ArgValue> idMap = new HashMap<>();
+ private ArgValuesMap avm;
+
/*
* Type type is only really used by --help-type
*/
private Type type = null;
- protected ArgValues(Arg a)
+ protected ArgValues(Arg a, ArgValuesMap avm)
{
this.arg = a;
this.argValueList = new ArrayList<ArgValue>();
this.boolValue = arg.getDefaultBoolValue();
+ this.avm = avm;
}
protected boolean setByWildcard()
}
protected void setBoolean(Type t, boolean b, int i,
- boolean beingSetByWildcard)
+ boolean beingSetByWildcard, String givenLinkedId)
{
this.setType(t);
// don't overwrite a wildcard set boolean with a non-wildcard set boolean
this.boolValue = b;
this.boolIndex = i;
this.setSetByWildcard(beingSetByWildcard);
+ this.givenLinkedId = givenLinkedId;
}
protected boolean getBoolean()
}
protected void addValue(Type type, String val, int argIndex,
- boolean wildcard)
+ boolean wildcard, String givenLinkedId)
{
- addArgValue(new ArgValue(arg(), type, val, argIndex), wildcard);
+ addArgValue(new ArgValue(arg(), type, val, argIndex, wildcard,
+ givenLinkedId, avm.getLinkedId()), wildcard);
}
protected void addValue(SubVals sv, Type type, String content,
- int argIndex, boolean wildcard)
+ int argIndex, boolean wildcard, String givenLinkedId)
{
- addArgValue(new ArgValue(arg(), sv, type, content, argIndex), wildcard);
+ addArgValue(new ArgValue(arg(), sv, type, content, argIndex, wildcard,
+ givenLinkedId, avm.getLinkedId()), wildcard);
}
protected void addArgValue(ArgValue av, boolean beingSetByWildcard)
}
return false;
}
+
+ public boolean setByWildcardLinkedId()
+ {
+ // looking for deliberately user set wildcard
+ return this.setByWildcard && this.givenLinkedId != null;
+ }
+
}
\ No newline at end of file