Merge branch 'bug/JAL-4353_cannot_output_multiple_different_structure_images_for_one_...
[jalview.git] / src / jalview / bin / argparser / ArgValues.java
index 8e4fe2c..55e1211 100644 (file)
@@ -44,6 +44,8 @@ public class ArgValues
 
   private boolean setByWildcard = false;
 
+  private String givenLinkedId = null;
+
   private int boolIndex = -1;
 
   private List<Integer> argsIndexes;
@@ -52,16 +54,19 @@ public class ArgValues
 
   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()
@@ -114,7 +119,7 @@ public class ArgValues
   }
 
   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
@@ -123,6 +128,7 @@ public class ArgValues
     this.boolValue = b;
     this.boolIndex = i;
     this.setSetByWildcard(beingSetByWildcard);
+    this.givenLinkedId = givenLinkedId;
   }
 
   protected boolean getBoolean()
@@ -157,15 +163,17 @@ public class ArgValues
   }
 
   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)
@@ -238,4 +246,11 @@ public class ArgValues
     }
     return false;
   }
+
+  public boolean setByWildcardLinkedId()
+  {
+    // looking for deliberately user set wildcard
+    return this.setByWildcard && this.givenLinkedId != null;
+  }
+
 }
\ No newline at end of file