/trunk/jsdoc-toolkit/app/lib/JSDOC.js

http://jsdoc-toolkit.googlecode.com/ · JavaScript · 108 lines · 58 code · 7 blank · 43 comment · 3 complexity · 66b30d8465c0e9da443201dc9a12df56 MD5 · raw file

  1. /**
  2. @overview
  3. @date $Date: 2010-07-03 09:55:05 +0200 (Sat, 03 Jul 2010) $
  4. @version $Revision: 846 $
  5. @location $HeadURL: http://jsdoc-toolkit.googlecode.com/svn/trunk/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. m: "multiple",
  29. n: "nocode",
  30. o: "out",
  31. p: "private",
  32. P: "plugins",
  33. q: "quiet",
  34. r: "recurse",
  35. S: "securemodules",
  36. s: "suppress",
  37. t: "template",
  38. T: "testmode",
  39. u: "unique",
  40. v: "verbose",
  41. x: "ext"
  42. }
  43. );
  44. /** The current version string of this application. */
  45. JSDOC.VERSION = "2.4.0";
  46. /** Print out usage information and quit. */
  47. JSDOC.usage = function() {
  48. print("USAGE: java -jar jsrun.jar app/run.js [OPTIONS] <SRC_DIR> <SRC_FILE> ...");
  49. print("");
  50. print("OPTIONS:");
  51. print(" -a or --allfunctions\n Include all functions, even undocumented ones.\n");
  52. print(" -c or --conf\n Load a configuration file.\n");
  53. print(" -d=<PATH> or --directory=<PATH>\n Output to this directory (defaults to \"out\").\n");
  54. print(" -D=\"myVar:My value\" or --define=\"myVar:My value\"\n Multiple. Define a variable, available in JsDoc as JSDOC.opt.D.myVar.\n");
  55. print(" -e=<ENCODING> or --encoding=<ENCODING>\n Use this encoding to read and write files.\n");
  56. print(" -E=\"REGEX\" or --exclude=\"REGEX\"\n Multiple. Exclude files based on the supplied regex.\n");
  57. print(" -h or --help\n Show this message and exit.\n");
  58. print(" -m or --multiples\n Don't warn about symbols being documented more than once.\n");
  59. print(" -n or --nocode\n Ignore all code, only document comments with @name tags.\n");
  60. print(" -o=<PATH> or --out=<PATH>\n Print log messages to a file (defaults to stdout).\n");
  61. print(" -p or --private\n Include symbols tagged as private, underscored and inner symbols.\n");
  62. print(" -P or --plugins\n Load additional plugins from the specified folder.\n");
  63. print(" -q or --quiet\n Do not output any messages, not even warnings.\n");
  64. print(" -r=<DEPTH> or --recurse=<DEPTH>\n Descend into src directories.\n");
  65. print(" -s or --suppress\n Suppress source code output.\n");
  66. print(" -S or --securemodules\n Use Secure Modules mode to parse source code.\n");
  67. print(" -t=<PATH> or --template=<PATH>\n Required. Use this template to format the output.\n");
  68. print(" -T or --test\n Run all unit tests and exit.\n");
  69. print(" -u or --unique\n Force file names to be unique, but not based on symbol names.\n");
  70. print(" -v or --verbose\n Provide verbose feedback about what is happening.\n");
  71. print(" -x=<EXT>[,EXT]... or --ext=<EXT>[,EXT]...\n Scan source files with the given extension/s (defaults to js).\n");
  72. quit();
  73. }
  74. /*t:
  75. plan(4, "Testing JSDOC namespace.");
  76. is(
  77. typeof JSDOC,
  78. "object",
  79. "JSDOC.usage is a function."
  80. );
  81. is(
  82. typeof JSDOC.VERSION,
  83. "string",
  84. "JSDOC.VERSION is a string."
  85. );
  86. is(
  87. typeof JSDOC.usage,
  88. "function",
  89. "JSDOC.usage is a function."
  90. );
  91. is(
  92. typeof JSDOC.opt,
  93. "object",
  94. "JSDOC.opt is a object."
  95. );
  96. */
  97. if (this.IO) IO.includeDir("lib/JSDOC/");