Merge branch 'develop' into bug/JAL-4059_update_swingJS_for_JalviewJS_2_11_2_and_2_11_3
[jalview.git] / src / jalview / bin / Jalview.java
index 83efe7d..ba9c5b0 100755 (executable)
@@ -100,6 +100,8 @@ import jalview.schemes.ColourSchemeI;
 import jalview.schemes.ColourSchemeProperty;
 import jalview.util.ChannelProperties;
 import jalview.util.HttpUtils;
+import jalview.util.IdUtils;
+import jalview.util.IdUtils.IdType;
 import jalview.util.LaunchUtils;
 import jalview.util.MessageManager;
 import jalview.util.Platform;
@@ -206,7 +208,7 @@ public class Jalview implements JalviewObjectI
     public void addFetcher(final AlignFrame af,
             final Vector<String> dasSources)
     {
-      final long id = System.currentTimeMillis();
+      final long id = IdUtils.newId(IdType.PROGRESS);
       queued++;
       final FeatureFetcher us = this;
       new Thread(new Runnable()
@@ -449,7 +451,7 @@ public class Jalview implements JalviewObjectI
       }
       else if (bootstrapArgs.contains(Arg.DEBUG))
       {
-        logLevel = "DEBUG";
+        logLevel = bootstrapArgs.getBoolean(Arg.DEBUG) ? "DEBUG" : "INFO";
       }
       if (logLevel == null && !(bootstrapProperties == null))
       {
@@ -837,36 +839,40 @@ public class Jalview implements JalviewObjectI
     }
 
     // Run Commands from cli
-    cmds = new Commands(argparser, headlessArg);
-    cmds.processArgs();
-    boolean commandsSuccess = cmds.argsWereParsed();
-
-    if (commandsSuccess)
+    boolean commandsSuccess = false;
+    if (!(argparser.isMixedStyle() || argparser.isOldStyle()))
     {
-      if (headlessArg)
+      cmds = new Commands(argparser, headlessArg);
+      cmds.processArgs();
+      commandsSuccess = cmds.argsWereParsed();
+
+      if (commandsSuccess)
       {
-        if (argparser.getBoolean(Arg.NOQUIT))
+        if (headlessArg)
         {
-          Console.warn(
-                  "Completed " + Arg.HEADLESS.getName() + " commands, but "
-                          + Arg.NOQUIT + " is set so not quitting!");
-        }
-        else
-        {
-          Jalview.exit("Successfully completed commands in headless mode",
-                  ExitCode.OK);
+          if (argparser.getBoolean(Arg.NOQUIT))
+          {
+            Console.warn("Completed " + Arg.HEADLESS.getName()
+                    + " commands, but " + Arg.NOQUIT
+                    + " is set so not quitting!");
+          }
+          else
+          {
+            Jalview.exit("Successfully completed commands in headless mode",
+                    ExitCode.OK);
+          }
         }
+        Console.info("Successfully completed commands");
       }
-      Console.info("Successfully completed commands");
-    }
-    else
-    {
-      if (headlessArg)
+      else
       {
-        Jalview.exit("Error when running Commands in headless mode",
-                ExitCode.ERROR_RUNNING_COMMANDS);
+        if (headlessArg)
+        {
+          Jalview.exit("Error when running Commands in headless mode",
+                  ExitCode.ERROR_RUNNING_COMMANDS);
+        }
+        Console.warn("Error when running commands");
       }
-      Console.warn("Error when running commands");
     }
 
     // Check if JVM and compile version might cause problems and log if it
@@ -907,7 +913,7 @@ public class Jalview implements JalviewObjectI
         desktop.setProgressBar(
                 MessageManager
                         .getString("status.processing_commandline_args"),
-                progress = System.currentTimeMillis());
+                progress = IdUtils.newId(IdType.PROGRESS));
       }
       Console.outPrintln("CMD [-open " + file + "] executed successfully!");