/tags/jsdoc_toolkit-2.3.2/jsdoc-toolkit/app/lib/JSDOC.js

http://jsdoc-toolkit.googlecode.com/ · JavaScript · 104 lines · 54 code · 7 blank · 43 comment · 3 complexity · aeddf99cbeca93eb734218a5dd3aa4dd MD5 · raw file

  1. /**
  2. @overview
  3. @date $Date: 2009-09-04 08:43:41 +0200 (Fri, 04 Sep 2009) $
  4. @version $Revision: 814 $
  5. @location $HeadURL: http://jsdoc-toolkit.googlecode.com/svn/tags/jsdoc_toolkit-2.3.2/jsdoc-toolkit/app/lib/JSDOC.js $
  6. @name JSDOC.js
  7. */
  8. /**
  9. This is the main container for the JSDOC application.
  10. @namespace
  11. */
  12. JSDOC = {
  13. };
  14. /**
  15. @requires Opt
  16. */
  17. if (typeof arguments == "undefined") arguments = [];
  18. JSDOC.opt = Opt.get(
  19. arguments,
  20. {
  21. a: "allfunctions",
  22. c: "conf",
  23. d: "directory",
  24. "D[]": "define",
  25. e: "encoding",
  26. "E[]": "exclude",
  27. h: "help",
  28. n: "nocode",
  29. o: "out",
  30. p: "private",
  31. q: "quiet",
  32. r: "recurse",
  33. S: "securemodules",
  34. s: "suppress",
  35. t: "template",
  36. T: "testmode",
  37. u: "unique",
  38. v: "verbose",
  39. x: "ext"
  40. }
  41. );
  42. /** The current version string of this application. */
  43. JSDOC.VERSION = "2.3.2";
  44. /** Print out usage information and quit. */
  45. JSDOC.usage = function() {
  46. print("USAGE: java -jar jsrun.jar app/run.js [OPTIONS] <SRC_DIR> <SRC_FILE> ...");
  47. print("");
  48. print("OPTIONS:");
  49. print(" -a or --allfunctions\n Include all functions, even undocumented ones.\n");
  50. print(" -c or --conf\n Load a configuration file.\n");
  51. print(" -d=<PATH> or --directory=<PATH>\n Output to this directory (defaults to \"out\").\n");
  52. print(" -D=\"myVar:My value\" or --define=\"myVar:My value\"\n Multiple. Define a variable, available in JsDoc as JSDOC.opt.D.myVar.\n");
  53. print(" -e=<ENCODING> or --encoding=<ENCODING>\n Use this encoding to read and write files.\n");
  54. print(" -E=\"REGEX\" or --exclude=\"REGEX\"\n Multiple. Exclude files based on the supplied regex.\n");
  55. print(" -h or --help\n Show this message and exit.\n");
  56. print(" -n or --nocode\n Ignore all code, only document comments with @name tags.\n");
  57. print(" -o=<PATH> or --out=<PATH>\n Print log messages to a file (defaults to stdout).\n");
  58. print(" -p or --private\n Include symbols tagged as private, underscored and inner symbols.\n");
  59. print(" -q or --quiet\n Do not output any messages, not even warnings.\n");
  60. print(" -r=<DEPTH> or --recurse=<DEPTH>\n Descend into src directories.\n");
  61. print(" -s or --suppress\n Suppress source code output.\n");
  62. print(" -S or --securemodules\n Use Secure Modules mode to parse source code.\n");
  63. print(" -t=<PATH> or --template=<PATH>\n Required. Use this template to format the output.\n");
  64. print(" -T or --test\n Run all unit tests and exit.\n");
  65. print(" -u or --unique\n Force file names to be unique, but not based on symbol names.\n");
  66. print(" -v or --verbose\n Provide verbose feedback about what is happening.\n");
  67. print(" -x=<EXT>[,EXT]... or --ext=<EXT>[,EXT]...\n Scan source files with the given extension/s (defaults to js).\n");
  68. quit();
  69. }
  70. /*t:
  71. plan(4, "Testing JSDOC namespace.");
  72. is(
  73. typeof JSDOC,
  74. "object",
  75. "JSDOC.usage is a function."
  76. );
  77. is(
  78. typeof JSDOC.VERSION,
  79. "string",
  80. "JSDOC.VERSION is a string."
  81. );
  82. is(
  83. typeof JSDOC.usage,
  84. "function",
  85. "JSDOC.usage is a function."
  86. );
  87. is(
  88. typeof JSDOC.opt,
  89. "object",
  90. "JSDOC.opt is a object."
  91. );
  92. */
  93. if (this.IO) IO.includeDir("lib/JSDOC/");