Force headless mode if "--tui" is passed
[jvcard.git] / src / be / nikiroo / jvcard / launcher / Main.java
index c3187a0591abefcd5dcd048e73e8dc3809f118c3..178dff106d11394fa0b08bf7fb754134caf5a52f 100644 (file)
@@ -28,7 +28,7 @@ import be.nikiroo.jvcard.resources.Trans.StringId;
  */
 public class Main {
        static public final String APPLICATION_TITLE = "jVcard";
-       static public final String APPLICATION_VERSION = "1.0-beta3";
+       static public final String APPLICATION_VERSION = "1.0-beta3-dev";
 
        static private final int ERR_NO_FILE = 1;
        static private final int ERR_SYNTAX = 2;
@@ -167,6 +167,12 @@ public class Main {
                                files.addAll(open(arg));
                        }
                }
+               
+               // Force headless mode if we run in forced-text mode
+               if (textMode != null && textMode) {
+                       // same as -Djava.awt.headless=true
+                       System.setProperty("java.awt.headless", "true");
+               }
 
                if (unicode) {
                        utf8();