1 30 31 35 36 package jbet.cmd; 37 import jbet.*; 38 39 public class help implements Command 40 { 41 public int helplevel() { return 5; } 42 public String shorthelp() { return "help on commands or syntax"; } 43 public String longhelp() { 44 return 45 "jbet help : display a list of commands\n" + 46 "jbet help <command> : display help on <command>\n"; } 47 48 50 public void run (Lexer lexer) throws Exception 51 { 52 lexer.match (Token.END_OF_OPTS); 53 Token tok = lexer.peek (); 54 55 if (tok.type == Token.NAME) { 56 lexer.match (Token.NAME); 57 58 Main.usage (tok.text); 59 } 60 else if (tok.type == Token.INT) { 61 lexer.match (Token.INT); 62 Main.usage ((int)tok.l); 63 } 64 else 65 Main.usage(); 66 } 67 } 68 | Popular Tags |