- System.setProperty("swing.plaf.metal.userFont", "Tahoma");
- System.setProperty("swing.plaf.metal.controlFont", "Tahoma");
- System.setProperty("swing.aatext", "true");
- debug = (args.length > 0) && (args[0].equals("--debug"));
- new Main();
+ String configFilename = null;
+ boolean nextIsConfigFilename = false;
+ for (String argument : args) {
+ if (nextIsConfigFilename) {
+ configFilename = argument;
+ nextIsConfigFilename = false;
+ }
+ if ("--help".equals(argument)) {
+ printHelp();
+ return;
+ } else if ("--debug".equals(argument)) {
+ debug = true;
+ } else if ("--config-file".equals(argument)) {
+ nextIsConfigFilename = true;
+ }
+ }
+ if (nextIsConfigFilename) {
+ System.out.println("--config-file needs parameter!");
+ return;
+ }
+ new Main(configFilename);
+ }
+
+ /**
+ * Prints a small syntax help.
+ */
+ private static void printHelp() {
+ System.out.println("--help\tshows this cruft");
+ System.out.println("--debug\tenables some debug output");
+ System.out.println("--config-file <file>\tuse specified configuration file");