diff --git a/src/de/tudbut/tryumph/Launch.java b/src/de/tudbut/tryumph/Launch.java index a803994..85e2f78 100644 --- a/src/de/tudbut/tryumph/Launch.java +++ b/src/de/tudbut/tryumph/Launch.java @@ -2,26 +2,29 @@ package de.tudbut.tryumph; import java.util.Arrays; +import de.tudbut.async.Task; import de.tudbut.tryumph.config.IRequestCatcher; import de.tudbut.tryumph.config.RequestCatcherConfig; import de.tudbut.tryumph.config.TryConfig; import de.tudbut.tryumph.err.ProjectException; import de.tudbut.tryumph.server.http.Server; import de.tudbut.tryumph.util.Bug; +import tudbut.global.DebugStateManager; public class Launch { - private static TryConfig config; - private static RequestCatcherConfig[] catchers; - public static void main(String[] args) throws ProjectException, InterruptedException { + public static void main(String[] args) throws ProjectException, InterruptedException { + if(args.length > 0 && args[0].equals("--debug")) + DebugStateManager.enableDebug(); + TryConfig config; + RequestCatcherConfig[] catchers; try { config = new TryConfig(args, Launch.class.getClassLoader().getResourceAsStream("config.try")); - catchers = config.getCatchers().ok().await(); + catchers = config.getCatchers().ok().await(); } catch(Exception e) { throw new ProjectException("Error loading project", e); } - System.out.println(Arrays.toString(catchers)); for(int i = 0; i < catchers.length; i++) { try { RequestCatcherConfig catcher = catchers[i];