package org.metaborg.sunshine;

import org.metaborg.core.MetaborgException;
import org.metaborg.spoofax.core.Spoofax;

import com.google.inject.Injector;
import com.martiansoftware.nailgun.NGContext;

public class Main {
    private static Injector injector;


    public static void main(String[] args) throws MetaborgException {
        final Spoofax spoofax = new Spoofax(new SunshineModule());
        injector = spoofax.injector;

        run(args, false);
    }

    public static void nailMain(NGContext context) {
        run(context.getArgs(), true);
    }


    private static void run(String[] args, boolean remote) {
        final Runner runner = injector.getInstance(Runner.class);
        final int result = runner.run(args, remote);
        System.exit(result);
    }
}

@@ -328,24 +328,28 @@
 n %7B%0A        
+try(
 final Spoofa
@@ -393,18 +393,24 @@
 odule())
-;%0A
+) %7B%0A    
         
@@ -438,17 +438,20 @@
 jector;%0A
-%0A
+    
         
@@ -464,24 +464,34 @@
 gs, false);%0A
+        %7D%0A
     %7D%0A%0A    p

Support shutdown cleanup