* 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

This commit is contained in:
Reinhard Pointner 2011-11-28 16:04:15 +00:00
parent 17107d503b
commit f1f56a5fd1
1 changed files with 2 additions and 1 deletions

View File

@ -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);