/** * Print a help message. * * <p>This method is defined as a JavaScript function. */ public void help() { p(""); p("Command Description"); p("======= ==========="); p("help() Display usage and help messages. "); p("defineClass(className) Define an extension using the Java class"); p(" named with the string argument. "); p(" Uses ScriptableObject.defineClass(). "); p("load(['foo.js', ...]) Load JavaScript source files named by "); p(" string arguments. "); p("loadClass(className) Load a class named by a string argument."); p(" The class must be a script compiled to a"); p(" class file. "); p("print([expr ...]) Evaluate and print expressions. "); p("quit() Quit the BasicRhinoShell. "); p("version([number]) Get or set the JavaScript version number."); p(""); }
/** Print a usage message. */ private static void usage(String s) { p("Didn't understand \"" + s + "\"."); p("Valid arguments are:"); p("-version 100|110|120|130|140|150|160|170"); System.exit(1); }