JAL-629 adjust arg type for tempfac-shading -- was grabbing next argument
authorBen Soares <b.soares@dundee.ac.uk>
Thu, 26 Jan 2023 11:09:47 +0000 (11:09 +0000)
committerBen Soares <b.soares@dundee.ac.uk>
Thu, 26 Jan 2023 11:09:47 +0000 (11:09 +0000)
src/jalview/bin/ArgParser.java
src/jalview/bin/Commands.java

index 877a7f6..bb88536 100644 (file)
@@ -103,7 +103,7 @@ public class ArgParser
       TEMPFAC.setOptions(Opt.STRING, Opt.LINKED);
       TEMPFAC_LABEL.setOptions(Opt.STRING, Opt.LINKED);
       TEMPFAC_DESC.setOptions(Opt.STRING, Opt.LINKED);
-      TEMPFAC_SHADING.setOptions(Opt.STRING, Opt.LINKED);
+      TEMPFAC_SHADING.setOptions(Opt.BOOLEAN, Opt.LINKED);
       TITLE.setOptions(Opt.STRING, Opt.LINKED);
       PAEMATRIX.setOptions(Opt.STRING, Opt.LINKED, Opt.MULTI);
       NOSTRUCTURE.setOptions(Opt.UNARY, Opt.LINKED);
index 5f40ba6..2d7f02b 100644 (file)
@@ -340,9 +340,6 @@ public class Commands
           Console.error("Could not open any files in headless mode");
           System.exit(1);
         }
-        // TOREMOVE COMMENT
-        // @Ben assumed this was the GUI version of above, rather then the
-        // first==false state
         else
         {
           Console.warn("No more files to open");
@@ -458,11 +455,10 @@ public class Commands
         }
       }
     }
-    String shading = ArgParser.getValue(m, Arg.TEMPFAC_SHADING);
-    if (shading != null)
+
+    boolean doShading = ArgParser.getBoolean(m, Arg.TEMPFAC_SHADING);
+    if (doShading)
     {
-      Console.debug(
-              "Annotation colour scheme : " + shading + " (ignored value)");
       AlignFrame af = afMap.get(id);
       for (AlignmentAnnotation aa : af.alignPanel.getAlignment()
               .findAnnotation(PDBChain.class.getName().toString()))
@@ -473,7 +469,6 @@ public class Commands
         af.changeColour(acg);
         Console.info("Changed colour " + acg.toString());
       }
-
     }
   }