public static void main(string[] args) { CommandInterpreter commandInterpreter = new CommandInterpreter(); try { [email protected]("Welcome to the Command interpreter test program"); commandInterpreter.setPrompt("CI> "); commandInterpreter.run(); [email protected]("Goodbye!"); } catch (System.Exception ex) { [email protected](ex); } }
public static void main(string[] args) { try { CommandInterpreter commandInterpreter = new CommandInterpreter(); SocketCommandClient socketCommandClient = new SocketCommandClient("localhost", 7890); commandInterpreter.add("s", new SocketCommandClient_1(socketCommandClient)); commandInterpreter.add("r", new SocketCommandClient_2(socketCommandClient)); commandInterpreter.add("sr", new SocketCommandClient_3(socketCommandClient)); commandInterpreter.setPrompt("scc-test> "); commandInterpreter.run(); } catch (System.Exception ex) { java.lang.System.err.println("error occured."); Throwable.instancehelper_printStackTrace(ex); java.lang.System.exit(-1); } return; }