2 * jSite - a tool for uploading websites into Freenet
3 * Copyright (C) 2006-2009 David Roden
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 package de.todesbaum.jsite.main;
22 import java.awt.event.ActionEvent;
23 import java.awt.event.ActionListener;
25 import java.io.IOException;
26 import java.text.MessageFormat;
27 import java.util.Date;
28 import java.util.HashMap;
29 import java.util.Locale;
32 import java.util.Map.Entry;
33 import java.util.logging.ConsoleHandler;
34 import java.util.logging.Handler;
35 import java.util.logging.Level;
36 import java.util.logging.Logger;
38 import javax.swing.AbstractAction;
39 import javax.swing.Action;
40 import javax.swing.ButtonGroup;
41 import javax.swing.Icon;
42 import javax.swing.JList;
43 import javax.swing.JMenu;
44 import javax.swing.JMenuBar;
45 import javax.swing.JOptionPane;
46 import javax.swing.JPanel;
47 import javax.swing.JRadioButtonMenuItem;
48 import javax.swing.event.ListSelectionEvent;
49 import javax.swing.event.ListSelectionListener;
51 import de.todesbaum.jsite.application.FileOption;
52 import de.todesbaum.jsite.application.Freenet7Interface;
53 import de.todesbaum.jsite.application.Node;
54 import de.todesbaum.jsite.application.Project;
55 import de.todesbaum.jsite.application.UpdateChecker;
56 import de.todesbaum.jsite.application.UpdateListener;
57 import de.todesbaum.jsite.gui.NodeManagerListener;
58 import de.todesbaum.jsite.gui.NodeManagerPage;
59 import de.todesbaum.jsite.gui.PreferencesPage;
60 import de.todesbaum.jsite.gui.ProjectFilesPage;
61 import de.todesbaum.jsite.gui.ProjectInsertPage;
62 import de.todesbaum.jsite.gui.ProjectPage;
63 import de.todesbaum.jsite.i18n.I18n;
64 import de.todesbaum.jsite.i18n.I18nContainer;
65 import de.todesbaum.util.image.IconLoader;
66 import de.todesbaum.util.swing.TWizard;
67 import de.todesbaum.util.swing.TWizardPage;
68 import de.todesbaum.util.swing.WizardListener;
71 * The main class that ties together everything.
73 * @author David ‘Bombe’ Roden <bombe@freenetproject.org>
75 public class Main implements ActionListener, ListSelectionListener, WizardListener, NodeManagerListener, UpdateListener {
78 @SuppressWarnings("unused")
79 private static final Logger logger = Logger.getLogger(Main.class.getName());
82 private static final Version VERSION = new Version(0, 7, 1);
84 /** The configuration. */
85 private Configuration configuration;
87 /** The freenet interface. */
88 private Freenet7Interface freenetInterface = new Freenet7Interface();
90 /** The update checker. */
91 private final UpdateChecker updateChecker;
93 /** The jSite icon. */
94 private Icon jSiteIcon;
97 * Enumeration for all possible pages.
99 * @author David ‘Bombe’ Roden <bombe@freenetproject.org>
101 private static enum PageType {
103 /** The node manager page. */
106 /** The project page. */
109 /** The project files page. */
112 /** The project insert page. */
115 /** The preferences page. */
120 /** The supported locales. */
121 private static final Locale[] SUPPORTED_LOCALES = new Locale[] { Locale.ENGLISH, Locale.GERMAN, Locale.FRENCH, Locale.ITALIAN, new Locale("pl") };
123 /** The actions that switch the language. */
124 private Map<Locale, Action> languageActions = new HashMap<Locale, Action>();
126 /** The “manage nodes” action. */
127 private Action manageNodeAction;
129 /** The “preferences” action. */
130 private Action optionsPreferencesAction;
132 /** The “check for updates” action. */
133 private Action checkForUpdatesAction;
135 /** The “about jSite” action. */
136 private Action aboutAction;
139 private TWizard wizard;
141 /** The node menu. */
142 private JMenu nodeMenu;
144 /** The currently selected node. */
145 private Node selectedNode;
147 /** Mapping from page type to page. */
148 private final Map<PageType, TWizardPage> pages = new HashMap<PageType, TWizardPage>();
151 * Creates a new core with the default configuration file.
158 * Creates a new core with the given configuration from the given file.
160 * @param configFilename
161 * The name of the configuration file
163 private Main(String configFilename) {
164 if (configFilename != null) {
165 configuration = new Configuration(configFilename);
167 configuration = new Configuration();
169 Locale.setDefault(configuration.getLocale());
170 I18n.setLocale(configuration.getLocale());
171 if (!configuration.createLockFile()) {
172 int option = JOptionPane.showOptionDialog(null, I18n.getMessage("jsite.main.already-running"), "", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, new Object[] { I18n.getMessage("jsite.main.already-running.override"), I18n.getMessage("jsite.wizard.quit") }, I18n.getMessage("jsite.wizard.quit"));
174 throw new IllegalStateException("Lockfile override not active, refusing start.");
176 configuration.removeLockfileOnExit();
178 wizard = new TWizard();
180 wizard.setJMenuBar(createMenuBar());
181 wizard.setQuitName(I18n.getMessage("jsite.wizard.quit"));
182 wizard.setPreviousEnabled(false);
183 wizard.setNextEnabled(true);
184 wizard.addWizardListener(this);
185 jSiteIcon = IconLoader.loadIcon("/jsite-icon.png");
186 wizard.setIcon(jSiteIcon);
188 updateChecker = new UpdateChecker(freenetInterface);
189 updateChecker.addUpdateListener(this);
190 updateChecker.start();
193 showPage(PageType.PAGE_PROJECTS);
197 * Creates all actions.
199 private void createActions() {
200 for (final Locale locale : SUPPORTED_LOCALES) {
201 languageActions.put(locale, new AbstractAction(I18n.getMessage("jsite.menu.language." + locale.getLanguage()), IconLoader.loadIcon("/flag-" + locale.getLanguage() + ".png")) {
203 @SuppressWarnings("synthetic-access")
204 public void actionPerformed(ActionEvent actionEvent) {
205 switchLanguage(locale);
209 manageNodeAction = new AbstractAction(I18n.getMessage("jsite.menu.nodes.manage-nodes")) {
211 @SuppressWarnings("synthetic-access")
212 public void actionPerformed(ActionEvent actionEvent) {
213 showPage(PageType.PAGE_NODE_MANAGER);
214 wizard.setPreviousName(I18n.getMessage("jsite.wizard.previous"));
215 wizard.setNextName(I18n.getMessage("jsite.wizard.next"));
218 optionsPreferencesAction = new AbstractAction(I18n.getMessage("jsite.menu.options.preferences")) {
224 @SuppressWarnings("synthetic-access")
225 public void actionPerformed(ActionEvent actionEvent) {
226 optionsPreferences();
229 checkForUpdatesAction = new AbstractAction(I18n.getMessage("jsite.menu.help.check-for-updates")) {
234 @SuppressWarnings("synthetic-access")
235 public void actionPerformed(ActionEvent actionEvent) {
239 aboutAction = new AbstractAction(I18n.getMessage("jsite.menu.help.about")) {
241 @SuppressWarnings("synthetic-access")
242 public void actionPerformed(ActionEvent e) {
243 JOptionPane.showMessageDialog(wizard, MessageFormat.format(I18n.getMessage("jsite.about.message"), getVersion().toString()), null, JOptionPane.INFORMATION_MESSAGE, jSiteIcon);
247 I18nContainer.getInstance().registerRunnable(new Runnable() {
249 @SuppressWarnings("synthetic-access")
251 manageNodeAction.putValue(Action.NAME, I18n.getMessage("jsite.menu.nodes.manage-nodes"));
252 optionsPreferencesAction.putValue(Action.NAME, I18n.getMessage("jsite.menu.options.preferences"));
253 checkForUpdatesAction.putValue(Action.NAME, I18n.getMessage("jsite.menu.help.check-for-updates"));
254 aboutAction.putValue(Action.NAME, I18n.getMessage("jsite.menu.help.about"));
260 * Creates the menu bar.
262 * @return The menu bar
264 private JMenuBar createMenuBar() {
265 JMenuBar menuBar = new JMenuBar();
266 final JMenu languageMenu = new JMenu(I18n.getMessage("jsite.menu.languages"));
267 menuBar.add(languageMenu);
268 ButtonGroup languageButtonGroup = new ButtonGroup();
269 for (Locale locale : SUPPORTED_LOCALES) {
270 Action languageAction = languageActions.get(locale);
271 JRadioButtonMenuItem menuItem = new JRadioButtonMenuItem(languageActions.get(locale));
272 if (locale.equals(Locale.getDefault())) {
273 menuItem.setSelected(true);
275 languageAction.putValue("menuItem", menuItem);
276 languageButtonGroup.add(menuItem);
277 languageMenu.add(menuItem);
279 nodeMenu = new JMenu(I18n.getMessage("jsite.menu.nodes"));
280 menuBar.add(nodeMenu);
281 selectedNode = configuration.getSelectedNode();
282 nodesUpdated(configuration.getNodes());
284 final JMenu optionsMenu = new JMenu(I18n.getMessage("jsite.menu.options"));
285 menuBar.add(optionsMenu);
286 optionsMenu.add(optionsPreferencesAction);
288 /* evil hack to right-align the help menu */
289 JPanel panel = new JPanel();
290 panel.setOpaque(false);
293 final JMenu helpMenu = new JMenu(I18n.getMessage("jsite.menu.help"));
294 menuBar.add(helpMenu);
295 helpMenu.add(checkForUpdatesAction);
296 helpMenu.add(aboutAction);
298 I18nContainer.getInstance().registerRunnable(new Runnable() {
300 @SuppressWarnings("synthetic-access")
302 languageMenu.setText(I18n.getMessage("jsite.menu.languages"));
303 nodeMenu.setText(I18n.getMessage("jsite.menu.nodes"));
304 optionsMenu.setText(I18n.getMessage("jsite.menu.options"));
305 helpMenu.setText(I18n.getMessage("jsite.menu.help"));
306 for (Map.Entry<Locale, Action> languageActionEntry : languageActions.entrySet()) {
307 languageActionEntry.getValue().putValue(Action.NAME, I18n.getMessage("jsite.menu.language." + languageActionEntry.getKey().getLanguage()));
316 * Initializes all pages.
318 private void initPages() {
319 NodeManagerPage nodeManagerPage = new NodeManagerPage(wizard);
320 nodeManagerPage.setName("page.node-manager");
321 nodeManagerPage.addNodeManagerListener(this);
322 nodeManagerPage.setNodes(configuration.getNodes());
323 pages.put(PageType.PAGE_NODE_MANAGER, nodeManagerPage);
325 ProjectPage projectPage = new ProjectPage(wizard);
326 projectPage.setName("page.project");
327 projectPage.setProjects(configuration.getProjects());
328 projectPage.setFreenetInterface(freenetInterface);
329 projectPage.addListSelectionListener(this);
330 pages.put(PageType.PAGE_PROJECTS, projectPage);
332 ProjectFilesPage projectFilesPage = new ProjectFilesPage(wizard);
333 projectFilesPage.setName("page.project.files");
334 pages.put(PageType.PAGE_PROJECT_FILES, projectFilesPage);
336 ProjectInsertPage projectInsertPage = new ProjectInsertPage(wizard);
337 projectInsertPage.setName("page.project.insert");
338 projectInsertPage.setFreenetInterface(freenetInterface);
339 pages.put(PageType.PAGE_INSERT_PROJECT, projectInsertPage);
341 PreferencesPage preferencesPage = new PreferencesPage(wizard);
342 preferencesPage.setName("page.preferences");
343 pages.put(PageType.PAGE_PREFERENCES, preferencesPage);
347 * Shows the page with the given type.
350 * The page type to show
352 private void showPage(PageType pageType) {
353 wizard.setPreviousEnabled(pageType.ordinal() > 0);
354 wizard.setNextEnabled(pageType.ordinal() < (pages.size() - 1));
355 wizard.setPage(pages.get(pageType));
356 wizard.setTitle(pages.get(pageType).getHeading() + " - jSite");
360 * Saves the configuration.
362 * @return <code>true</code> if the configuration could be saved,
363 * <code>false</code> otherwise
365 private boolean saveConfiguration() {
366 NodeManagerPage nodeManagerPage = (NodeManagerPage) pages.get(PageType.PAGE_NODE_MANAGER);
367 configuration.setNodes(nodeManagerPage.getNodes());
368 if (selectedNode != null) {
369 configuration.setSelectedNode(selectedNode);
372 ProjectPage projectPage = (ProjectPage) pages.get(PageType.PAGE_PROJECTS);
373 configuration.setProjects(projectPage.getProjects());
375 return configuration.save();
379 * Finds a supported locale for the given locale.
382 * The locale to find a supported locale for
383 * @return The supported locale that was found, or the default locale if no
384 * supported locale could be found
386 private Locale findSupportedLocale(Locale forLocale) {
387 for (Locale locale : SUPPORTED_LOCALES) {
388 if (locale.equals(forLocale)) {
392 for (Locale locale : SUPPORTED_LOCALES) {
393 if (locale.getCountry().equals(forLocale.getCountry()) && locale.getLanguage().equals(forLocale.getLanguage())) {
397 for (Locale locale : SUPPORTED_LOCALES) {
398 if (locale.getLanguage().equals(forLocale.getLanguage())) {
402 return SUPPORTED_LOCALES[0];
406 * Returns the version.
408 * @return The version
410 public static final Version getVersion() {
419 * Switches the language of the interface to the given locale.
422 * The locale to switch to
424 private void switchLanguage(Locale locale) {
425 Locale supportedLocale = findSupportedLocale(locale);
426 Action languageAction = languageActions.get(supportedLocale);
427 JRadioButtonMenuItem menuItem = (JRadioButtonMenuItem) languageAction.getValue("menuItem");
428 menuItem.setSelected(true);
429 I18n.setLocale(supportedLocale);
430 for (Runnable i18nRunnable : I18nContainer.getInstance()) {
433 } catch (Throwable t) {
434 /* we probably shouldn't swallow this. */
437 wizard.setPage(wizard.getPage());
438 configuration.setLocale(supportedLocale);
442 * Shows a dialog with general preferences.
444 private void optionsPreferences() {
445 showPage(PageType.PAGE_PREFERENCES);
446 optionsPreferencesAction.setEnabled(false);
447 wizard.setNextEnabled(true);
451 * Shows a dialog box that shows the last version that was found by the
452 * {@link UpdateChecker}.
454 private void showLatestUpdate() {
455 Version latestVersion = updateChecker.getLatestVersion();
456 int versionDifference = latestVersion.compareTo(VERSION);
457 if (versionDifference > 0) {
458 JOptionPane.showMessageDialog(wizard, MessageFormat.format(I18n.getMessage("jsite.update-checker.latest-version.newer.message"), VERSION, latestVersion), I18n.getMessage("jsite.update-checker.latest-version.title"), JOptionPane.INFORMATION_MESSAGE);
459 } else if (versionDifference < 0) {
460 JOptionPane.showMessageDialog(wizard, MessageFormat.format(I18n.getMessage("jsite.update-checker.latest-version.older.message"), VERSION, latestVersion), I18n.getMessage("jsite.update-checker.latest-version.title"), JOptionPane.INFORMATION_MESSAGE);
462 JOptionPane.showMessageDialog(wizard, MessageFormat.format(I18n.getMessage("jsite.update-checker.latest-version.okay.message"), VERSION, latestVersion), I18n.getMessage("jsite.update-checker.latest-version.title"), JOptionPane.INFORMATION_MESSAGE);
467 // INTERFACE ListSelectionListener
473 public void valueChanged(ListSelectionEvent e) {
474 JList list = (JList) e.getSource();
475 int selectedRow = list.getSelectedIndex();
476 wizard.setNextEnabled(selectedRow > -1);
480 // INTERFACE WizardListener
486 public void wizardNextPressed(TWizard wizard) {
487 String pageName = wizard.getPage().getName();
488 if ("page.node-manager".equals(pageName)) {
489 showPage(PageType.PAGE_PROJECTS);
490 } else if ("page.project".equals(pageName)) {
491 ProjectPage projectPage = (ProjectPage) wizard.getPage();
492 Project project = projectPage.getSelectedProject();
493 if ((project.getLocalPath() == null) || (project.getLocalPath().trim().length() == 0)) {
494 JOptionPane.showMessageDialog(wizard, I18n.getMessage("jsite.project.warning.no-local-path"), null, JOptionPane.ERROR_MESSAGE);
497 if ((project.getPath() == null) || (project.getPath().trim().length() == 0)) {
498 JOptionPane.showMessageDialog(wizard, I18n.getMessage("jsite.project.warning.no-path"), null, JOptionPane.ERROR_MESSAGE);
501 ((ProjectFilesPage) pages.get(PageType.PAGE_PROJECT_FILES)).setProject(project);
502 ((ProjectInsertPage) pages.get(PageType.PAGE_INSERT_PROJECT)).setProject(project);
503 showPage(PageType.PAGE_PROJECT_FILES);
504 } else if ("page.project.files".equals(pageName)) {
505 ProjectPage projectPage = (ProjectPage) pages.get(PageType.PAGE_PROJECTS);
506 Project project = projectPage.getSelectedProject();
507 if (selectedNode == null) {
508 JOptionPane.showMessageDialog(wizard, I18n.getMessage("jsite.project-files.no-node-selected"), null, JOptionPane.ERROR_MESSAGE);
511 if ((project.getIndexFile() == null) || (project.getIndexFile().length() == 0)) {
512 if (JOptionPane.showConfirmDialog(wizard, I18n.getMessage("jsite.project-files.empty-index"), null, JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE) != JOptionPane.OK_OPTION) {
516 File indexFile = new File(project.getLocalPath(), project.getIndexFile());
517 if (!indexFile.exists()) {
518 JOptionPane.showMessageDialog(wizard, I18n.getMessage("jsite.project-files.index-missing"), null, JOptionPane.ERROR_MESSAGE);
522 String indexFile = project.getIndexFile();
523 boolean hasIndexFile = (indexFile != null);
524 if (hasIndexFile && !project.getFileOption(indexFile).getContainer().equals("")) {
525 if (JOptionPane.showConfirmDialog(wizard, I18n.getMessage("jsite.project-files.container-index"), null, JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE) != JOptionPane.OK_OPTION) {
529 if (hasIndexFile && !project.getFileOption(indexFile).getMimeType().equals("text/html")) {
530 if (JOptionPane.showConfirmDialog(wizard, I18n.getMessage("jsite.project-files.index-not-html"), null, JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE) != JOptionPane.OK_OPTION) {
534 Map<String, FileOption> fileOptions = project.getFileOptions();
535 Set<Entry<String, FileOption>> fileOptionEntries = fileOptions.entrySet();
536 for (Entry<String, FileOption> fileOptionEntry : fileOptionEntries) {
537 FileOption fileOption = fileOptionEntry.getValue();
538 if (!fileOption.isInsert() && ((fileOption.getCustomKey().length() == 0) || "CHK@".equals(fileOption.getCustomKey()))) {
539 JOptionPane.showMessageDialog(wizard, MessageFormat.format(I18n.getMessage("jsite.project-files.no-custom-key"), fileOptionEntry.getKey()), null, JOptionPane.ERROR_MESSAGE);
543 boolean nodeRunning = false;
545 nodeRunning = freenetInterface.isNodePresent();
546 } catch (IOException e) {
550 JOptionPane.showMessageDialog(wizard, I18n.getMessage("jsite.project-files.no-node-running"), null, JOptionPane.ERROR_MESSAGE);
553 configuration.save();
554 showPage(PageType.PAGE_INSERT_PROJECT);
555 ((ProjectInsertPage) pages.get(PageType.PAGE_INSERT_PROJECT)).startInsert();
556 nodeMenu.setEnabled(false);
557 } else if ("page.project.insert".equals(pageName)) {
558 showPage(PageType.PAGE_PROJECTS);
559 nodeMenu.setEnabled(true);
560 } else if ("page.preferences".equals(pageName)) {
561 showPage(PageType.PAGE_PROJECTS);
562 optionsPreferencesAction.setEnabled(true);
563 String tempDirectory = ((PreferencesPage) pages.get(PageType.PAGE_PREFERENCES)).getTempDirectory();
564 ((ProjectInsertPage) pages.get(PageType.PAGE_INSERT_PROJECT)).setTempDirectory(tempDirectory);
571 public void wizardPreviousPressed(TWizard wizard) {
572 String pageName = wizard.getPage().getName();
573 if ("page.project".equals(pageName)) {
574 showPage(PageType.PAGE_NODE_MANAGER);
575 } else if ("page.project.files".equals(pageName)) {
576 showPage(PageType.PAGE_PROJECTS);
577 } else if ("page.project.insert".equals(pageName)) {
578 showPage(PageType.PAGE_PROJECT_FILES);
585 public void wizardQuitPressed(TWizard wizard) {
586 if (JOptionPane.showConfirmDialog(wizard, I18n.getMessage("jsite.quit.question"), null, JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.OK_OPTION) {
587 if (saveConfiguration()) {
590 if (JOptionPane.showConfirmDialog(wizard, I18n.getMessage("jsite.quit.config-not-saved"), null, JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE) == JOptionPane.OK_OPTION) {
597 // INTERFACE NodeManagerListener
603 public void nodesUpdated(Node[] nodes) {
604 nodeMenu.removeAll();
605 ButtonGroup nodeButtonGroup = new ButtonGroup();
606 Node newSelectedNode = null;
607 for (Node node : nodes) {
608 JRadioButtonMenuItem nodeMenuItem = new JRadioButtonMenuItem(node.getName());
609 nodeMenuItem.putClientProperty("Node", node);
610 nodeMenuItem.addActionListener(this);
611 nodeButtonGroup.add(nodeMenuItem);
612 if (node.equals(selectedNode)) {
613 newSelectedNode = node;
614 nodeMenuItem.setSelected(true);
616 nodeMenu.add(nodeMenuItem);
618 nodeMenu.addSeparator();
619 nodeMenu.add(manageNodeAction);
620 selectedNode = newSelectedNode;
621 freenetInterface.setNode(selectedNode);
627 public void actionPerformed(ActionEvent e) {
628 Object source = e.getSource();
629 if (source instanceof JRadioButtonMenuItem) {
630 JRadioButtonMenuItem menuItem = (JRadioButtonMenuItem) source;
631 Node node = (Node) menuItem.getClientProperty("Node");
633 freenetInterface.setNode(selectedNode);
638 // INTERFACE UpdateListener
644 public void foundUpdateData(Version foundVersion, long versionTimestamp) {
645 if (foundVersion.compareTo(VERSION) > 0) {
646 JOptionPane.showMessageDialog(wizard, MessageFormat.format(I18n.getMessage("jsite.update-checker.found-version.message"), foundVersion.toString(), new Date(versionTimestamp)), I18n.getMessage("jsite.update-checker.found-version.title"), JOptionPane.INFORMATION_MESSAGE);
655 * Main method that is called by the VM.
658 * The command-line arguments
660 public static void main(String[] args) {
661 /* initialize logger. */
662 Logger logger = Logger.getLogger("de.todesbaum");
663 Handler handler = new ConsoleHandler();
664 logger.addHandler(handler);
665 String configFilename = null;
666 boolean nextIsConfigFilename = false;
667 for (String argument : args) {
668 if (nextIsConfigFilename) {
669 configFilename = argument;
670 nextIsConfigFilename = false;
672 if ("--help".equals(argument)) {
675 } else if ("--debug".equals(argument)) {
676 logger.setLevel(Level.ALL);
677 handler.setLevel(Level.ALL);
678 } else if ("--config-file".equals(argument)) {
679 nextIsConfigFilename = true;
682 if (nextIsConfigFilename) {
683 System.out.println("--config-file needs parameter!");
686 new Main(configFilename);
690 * Prints a small syntax help.
692 private static void printHelp() {
693 System.out.println("--help\tshows this cruft");
694 System.out.println("--debug\tenables some debug output");
695 System.out.println("--config-file <file>\tuse specified configuration file");