|
1 /** |
|
2 @overview |
|
3 @date $Date: 2009-06-21 23:36:33 +0100 (Sun, 21 Jun 2009) $ |
|
4 @version $Revision: 801 $ |
|
5 @location $HeadURL: https://jsdoc-toolkit.googlecode.com/svn/trunk/jsdoc-toolkit/app/lib/JSDOC.js $ |
|
6 @name JSDOC.js |
|
7 */ |
|
8 |
|
9 /** |
|
10 This is the main container for the JSDOC application. |
|
11 @namespace |
|
12 */ |
|
13 JSDOC = { |
|
14 }; |
|
15 |
|
16 /** |
|
17 @requires Opt |
|
18 */ |
|
19 if (typeof arguments == "undefined") arguments = []; |
|
20 JSDOC.opt = Opt.get( |
|
21 arguments, |
|
22 { |
|
23 a: "allfunctions", |
|
24 c: "conf", |
|
25 d: "directory", |
|
26 "D[]": "define", |
|
27 e: "encoding", |
|
28 "E[]": "exclude", |
|
29 h: "help", |
|
30 n: "nocode", |
|
31 o: "out", |
|
32 p: "private", |
|
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 |
|
45 /** The current version string of this application. */ |
|
46 JSDOC.VERSION = "2.3.0"; |
|
47 |
|
48 /** Print out usage information and quit. */ |
|
49 JSDOC.usage = function() { |
|
50 print("USAGE: java -jar jsrun.jar app/run.js [OPTIONS] <SRC_DIR> <SRC_FILE> ..."); |
|
51 print(""); |
|
52 print("OPTIONS:"); |
|
53 print(" -a or --allfunctions\n Include all functions, even undocumented ones.\n"); |
|
54 print(" -c or --conf\n Load a configuration file.\n"); |
|
55 print(" -d=<PATH> or --directory=<PATH>\n Output to this directory (defaults to \"out\").\n"); |
|
56 print(" -D=\"myVar:My value\" or --define=\"myVar:My value\"\n Multiple. Define a variable, available in JsDoc as JSDOC.opt.D.myVar.\n"); |
|
57 print(" -e=<ENCODING> or --encoding=<ENCODING>\n Use this encoding to read and write files.\n"); |
|
58 print(" -E=\"REGEX\" or --exclude=\"REGEX\"\n Multiple. Exclude files based on the supplied regex.\n"); |
|
59 print(" -h or --help\n Show this message and exit.\n"); |
|
60 print(" -n or --nocode\n Ignore all code, only document comments with @name tags.\n"); |
|
61 print(" -o=<PATH> or --out=<PATH>\n Print log messages to a file (defaults to stdout).\n"); |
|
62 print(" -p or --private\n Include symbols tagged as private, underscored and inner symbols.\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 |
|
73 quit(); |
|
74 } |
|
75 |
|
76 /*t: |
|
77 plan(4, "Testing JSDOC namespace."); |
|
78 |
|
79 is( |
|
80 typeof JSDOC, |
|
81 "object", |
|
82 "JSDOC.usage is a function." |
|
83 ); |
|
84 |
|
85 is( |
|
86 typeof JSDOC.VERSION, |
|
87 "string", |
|
88 "JSDOC.VERSION is a string." |
|
89 ); |
|
90 |
|
91 is( |
|
92 typeof JSDOC.usage, |
|
93 "function", |
|
94 "JSDOC.usage is a function." |
|
95 ); |
|
96 |
|
97 is( |
|
98 typeof JSDOC.opt, |
|
99 "object", |
|
100 "JSDOC.opt is a object." |
|
101 ); |
|
102 */ |
|
103 |
|
104 if (this.IO) IO.includeDir("lib/JSDOC/"); |