JAL-629 added setprop. More filename based substitutions enabled. Test for these.
[jalview.git] / src / jalview / bin / argparser / BootstrapArgs.java
index f6b592b..0d648a4 100644 (file)
@@ -38,7 +38,7 @@ public class BootstrapArgs
       {
         // remove "--"
         arg = arg.substring(ArgParser.DOUBLEDASH.length());
-        int equalPos = arg.indexOf('=');
+        int equalPos = arg.indexOf(ArgParser.EQUALS);
         if (equalPos > -1
                 && ArgParser.argMap.containsKey(arg.substring(0, equalPos)))
         {
@@ -152,11 +152,22 @@ public class BootstrapArgs
     return (aL == null || aL.size() == 0) ? null : aL.get(0);
   }
 
+  public boolean getBoolean(Arg a, boolean d)
+  {
+    if (!bootstrapArgMap.containsKey(a))
+      return d;
+    return Boolean.parseBoolean(get(a));
+  }
+
   public boolean getBoolean(Arg a)
   {
-    if (!bootstrapArgMap.containsKey(a)
-            || !(a.hasOption(Opt.BOOLEAN) || a.hasOption(Opt.UNARY)))
+    if (!(a.hasOption(Opt.BOOLEAN) || a.hasOption(Opt.UNARY)))
+    {
       return false;
-    return Boolean.parseBoolean(get(a));
+    }
+    if (bootstrapArgMap.containsKey(a))
+      return Boolean.parseBoolean(get(a));
+    else
+      return a.getDefaultBoolValue();
   }
 }