*/
private boolean allStructures = false;
+ /**
+ * flag to say whether to ignore or reject non-string values args with a value
+ * e.g., --wrap=hello
+ *
+ * Default is false (i.e. reject non-string args that have a value. It is set
+ * to true for JalviewJS in Platform.getURLCommandArguments().
+ */
+ private static boolean ignoreNonStringValues = false;
+
protected static final Map<String, Arg> argMap;
protected Map<String, ArgValuesMap> linkedArgs = new HashMap<>();
}
if (bsa != null)
+ {
this.bootstrapArgs = bsa;
+ }
else
+ {
this.bootstrapArgs = BootstrapArgs.getBootstrapArgs(args);
+ }
parse(args, initsubstitutions, allowPrivate);
}
}
if (!a.hasOption(Opt.STRING) && equalPos > -1)
{
- // set --argname=value when arg does not accept values
- Console.error("Argument '" + a.argString()
- + "' does not expect a value (given as '" + arg
- + "'). Ignoring.");
- continue;
+ if (!getIgnoreNonStringValues())
+ {
+ // delete equals sign and value
+ val = null;
+ arg = arg.substring(0, equalPos);
+ }
+ else
+ {
+ // set --argname=value when arg does not accept values
+ Console.error("Argument '" + a.argString()
+ + "' does not expect a value (given as '" + arg
+ + "'). Ignoring.");
+ continue;
+ }
}
if (!a.hasOption(Opt.LINKED) && linkedId != null)
{
this.currentStructureFilename = s;
}
+ public static boolean getIgnoreNonStringValues()
+ {
+ return ignoreNonStringValues;
+ }
+
+ public static void setIgnoreNonStringValues(boolean b)
+ {
+ ignoreNonStringValues = b;
+ }
}
\ No newline at end of file