* 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:
parent
17107d503b
commit
f1f56a5fd1
|
@ -5,6 +5,7 @@ package net.sourceforge.filebot;
|
||||||
import static javax.swing.JFrame.*;
|
import static javax.swing.JFrame.*;
|
||||||
import static net.sourceforge.tuned.ui.TunedUtilities.*;
|
import static net.sourceforge.tuned.ui.TunedUtilities.*;
|
||||||
|
|
||||||
|
import java.awt.GraphicsEnvironment;
|
||||||
import java.awt.event.WindowAdapter;
|
import java.awt.event.WindowAdapter;
|
||||||
import java.awt.event.WindowEvent;
|
import java.awt.event.WindowEvent;
|
||||||
import java.security.CodeSource;
|
import java.security.CodeSource;
|
||||||
|
@ -48,7 +49,7 @@ public class Main {
|
||||||
final ArgumentProcessor cli = new ArgumentProcessor();
|
final ArgumentProcessor cli = new ArgumentProcessor();
|
||||||
final ArgumentBean argumentBean = cli.parse(args);
|
final ArgumentBean argumentBean = cli.parse(args);
|
||||||
|
|
||||||
if (argumentBean.printHelp()) {
|
if (argumentBean.printHelp() || (GraphicsEnvironment.isHeadless() && !argumentBean.runCLI())) {
|
||||||
// just print help message and exit afterwards
|
// just print help message and exit afterwards
|
||||||
cli.printHelp(argumentBean);
|
cli.printHelp(argumentBean);
|
||||||
System.exit(0);
|
System.exit(0);
|
||||||
|
|
Loading…
Reference in New Issue