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

http://jsdoc-toolkit.googlecode.com/ · JavaScript · 103 lines · 53 code · 7 blank · 43 comment · 3 complexity · 974cbb125e393b17e4173a8886dd9cdf MD5 · raw file

  1. /**
  2. @overview
  3. @date $Date: 2009-05-09 14:18:50 +0200 (Sat, 09 May 2009) $
  4. @version $Revision: 788 $
  5. @location $HeadURL: http://jsdoc-toolkit.googlecode.com/svn/tags/jsdoc_toolkit-2.2.1/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. d: "directory",
  22. c: "conf",
  23. t: "template",
  24. r: "recurse",
  25. x: "ext",
  26. p: "private",
  27. a: "allfunctions",
  28. e: "encoding",
  29. n: "nocode",
  30. o: "out",
  31. s: "suppress",
  32. S: "securemodules",
  33. q: "quiet",
  34. T: "testmode",
  35. h: "help",
  36. v: "verbose",
  37. "D[]": "define",
  38. "E[]": "exclude",
  39. "H[]": "handler"
  40. }
  41. );
  42. /** The current version string of this application. */
  43. JSDOC.VERSION = "2.1.1";
  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(" -v or --verbose\n Provide verbose feedback about what is happening.\n");
  66. print(" -x=<EXT>[,EXT]... or --ext=<EXT>[,EXT]...\n Scan source files with the given extension/s (defaults to js).\n");
  67. quit();
  68. }
  69. /*t:
  70. plan(4, "Testing JSDOC namespace.");
  71. is(
  72. typeof JSDOC,
  73. "object",
  74. "JSDOC.usage is a function."
  75. );
  76. is(
  77. typeof JSDOC.VERSION,
  78. "string",
  79. "JSDOC.VERSION is a string."
  80. );
  81. is(
  82. typeof JSDOC.usage,
  83. "function",
  84. "JSDOC.usage is a function."
  85. );
  86. is(
  87. typeof JSDOC.opt,
  88. "object",
  89. "JSDOC.opt is a object."
  90. );
  91. */
  92. if (this.IO) IO.includeDir("lib/JSDOC/");