package min;

import min.lang.MinObject;
import min.lang.Message;
//import min.lang.Method;
import min.lang.File;
import min.lang.Bootstrap;
//import java.util.ArrayList;

public class main {
  public static void main(String[] args) throws Exception {
    String code = null;
    String file = "<eval>";
    boolean debug = false;
    
    for (int i = 0; i < args.length; i++) {
      if (args[i].equals("-e")) code = args[++i];
      else if (args[i].equals("-d")) debug = true;
      else code = File.read(file = args[i]);
    }
    
    if (code == null) {
      System.out.println("usage: min [-d] < -e code | file.min >");
      System.exit(1);
    }

    new Bootstrap().run();
    Message message = Message.parse(code, file);
    if (debug) System.out.println(message.fullName());
    message.evalOn(MinObject.lobby);
  }
}
@@ -474,16 +474,62 @@
 = true;%0A
+      else if (args%5Bi%5D.equals(%22-h%22)) usage();%0A
       el
@@ -610,89 +610,14 @@
     
-System.out.println(%22usage: min %5B-d%5D %3C -e code %7C file.min %3E%22);%0A      System.exit(1
+usage(
 );%0A 
@@ -794,9 +794,132 @@
 y);%0A  %7D%0A
+%0A  public static void usage() %7B%0A    System.out.println(%22usage: min %5B-d%5D %3C -e code %7C file.min %3E%22);%0A    System.exit(1);%0A  %7D%0A%0A
 %7D

handle -h command line args