public static void parse(Main m, String[] params) { System.out.println("Parsing ..."); for (int i = 0; i < params.length; i++) { System.out.println("- " + params[i]); } for (int i = 0; i < params.length; i++) { String s = params[i]; if (s.equals("mcpath")) { m.mcpath = params[++i]; } else if (s.equals("action")) { m.addAction(params[++i]); } else System.out.println("UNKNOWN CONFIG LINE: " + s); } System.out.println("... Done."); }
public static void main(String[] args) { Main m = new Main(); parse(m, ConfigParser.expand(args)); m.start(); }