package com.fatico.winthing;

import com.fatico.winthing.messaging.Engine;

import com.google.inject.Guice;
import com.google.inject.Injector;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class Application {

    private static final Logger logger = LoggerFactory.getLogger(Application.class);

    public static void main(final String[] args) {
        try {
            final Injector injector = Guice.createInjector(new ApplicationModule());
            final Engine engine = injector.getInstance(Engine.class);
            engine.run();
        } catch (final Throwable throwable) {
            logger.error("Critical error.", throwable);
            System.exit(1);
        }
    }

}

@@ -23,16 +23,58 @@
 thing;%0A%0A
+import com.fatico.winthing.gui.WindowGUI;%0A
 import c
@@ -110,17 +110,16 @@
 Engine;%0A
-%0A
 import c
@@ -177,16 +177,17 @@
 jector;%0A
+%0A
 import o
@@ -263,16 +263,56 @@
 ation %7B%0A
+%09public static boolean APPDEBUG = false;
 %0A    pri
@@ -459,28 +459,143 @@
 y %7B%0A        
-    
+%09parseArgs(args);%0A        %09%0A        %09WindowGUI gui = WindowGUI.getInstance();%0A        %09gui.tray();%0A        %09 %0A        %09
 final Inject
@@ -663,20 +663,17 @@
         
-    
+%09
 final En
@@ -730,20 +730,17 @@
         
-    
+%09
 engine.r
@@ -741,24 +741,34 @@
 gine.run();%0A
+        %09%0A
         %7D ca
@@ -901,11 +901,175 @@
 %7D%0A    %7D%0A
+    %0A    public static void parseArgs(String%5B%5D args) %7B%0A    %09for (String arg : args) %7B%0A    %09%09if (arg.equals(%22-debug%22)) %7B%0A    %09%09%09APPDEBUG = true;%0A    %09%09%7D%0A    %09%7D%0A    %7D
 %0A%7D%0A

add tray icon