package magic;

import java.io.FileNotFoundException;

import magic.compiler.EvalResult;
import magic.lang.Context;

/**
 * Main class for Magic execution
 * 
 * @author Mike
 */
public class Main {

	private static final Context MAIN_CONTEXT=Core.INITIAL_CONTEXT;
	
	public static void main(String... args) throws FileNotFoundException {
		if (args.length>0) {
			String s=RT.getResourceAsString(args[0]);
			evaluate(MAIN_CONTEXT,s);
		} else {
			System.out.println("Magic! 0.0.1");
		}
	}

	private static EvalResult<?> evaluate(Context c, String s) {
		EvalResult<?> r=magic.compiler.Compiler.compile(c,s);
		return r;	
	}
}

@@ -353,141 +353,472 @@
 ngth
-%3E0) %7B%0A%09%09%09String s=RT.getResourceAsString(args%5B0%5D);%0A%09%09%09evaluate(MAIN_CONTEXT,s);%0A%09%09%7D else %7B%0A%09%09%09System.out.println(%22Magic! 0.0.1%22);%0A%09%09%7D
+==0%7C%7C(args%5B0%5D.equals(%22help%22))) %7B%0A%09%09%09System.out.println(%22Magic! 0.0.1%22);%0A%09%09%09System.out.println(%22Optional arguments:%22);%0A%09%09%09System.out.println(%22   help          =%3E Display this help message%22);%0A%09%09%09System.out.println(%22   %3Cfilename%3E    =%3E Execute a magic .mag script with the gievn filename%22);%0A%09%09%09System.out.println(%22   repl          =%3E Launch a standard Magic REPL (TODO)%22);%0A%09%09%09System.exit(0);%0A%09%09%7D%0A%09%09String s=RT.getResourceAsString(args%5B0%5D);%0A%09%09evaluate(MAIN_CONTEXT,s);
 %0A%09%7D%0A

Fix main method