JAL-3830 Look for --headless mode and add -Djava.awt.headless=true to java invocation...
[jalview.git] / src / jalview / bin / Jalview.java
index 3a733f3..1f86926 100755 (executable)
@@ -810,6 +810,7 @@ public class Jalview
     // Run Commands from cli
     cmds = new Commands(argparser, headlessArg);
     boolean commandsSuccess = cmds.argsWereParsed();
+
     if (commandsSuccess)
     {
       if (headlessArg)
@@ -822,6 +823,11 @@ public class Jalview
         }
         else
         {
+          // record usage stats if in headless mode
+          if (Cache.getDefault("USAGESTATS", false))
+          {
+            Cache.initGoogleTracker(headlessArg);
+          }
           Jalview.exit("Successfully completed commands in headless mode",
                   0);
         }