From f1f56a5fd1f8c8b022ea4d01d272799b1795ab06 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Mon, 28 Nov 2011 16:04:15 +0000 Subject: [PATCH] * without CLI arguments we would normally start into the GUI, but if we're running headless that would fail anyway, so let's just print help and exit --- source/net/sourceforge/filebot/Main.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/net/sourceforge/filebot/Main.java b/source/net/sourceforge/filebot/Main.java index ec8df32b..80ad1585 100644 --- a/source/net/sourceforge/filebot/Main.java +++ b/source/net/sourceforge/filebot/Main.java @@ -5,6 +5,7 @@ package net.sourceforge.filebot; import static javax.swing.JFrame.*; import static net.sourceforge.tuned.ui.TunedUtilities.*; +import java.awt.GraphicsEnvironment; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.security.CodeSource; @@ -48,7 +49,7 @@ public class Main { final ArgumentProcessor cli = new ArgumentProcessor(); final ArgumentBean argumentBean = cli.parse(args); - if (argumentBean.printHelp()) { + if (argumentBean.printHelp() || (GraphicsEnvironment.isHeadless() && !argumentBean.runCLI())) { // just print help message and exit afterwards cli.printHelp(argumentBean); System.exit(0);