1 /** 2 @overview 3 @date $Date: 2009-09-04 07:43:41 +0100 (Fri, 04 Sep 2009) $ 4 @version $Revision: 814 $ 5 @location $HeadURL: https://jsdoc-toolkit.googlecode.com/svn/tags/jsdoc_toolkit-2.3.2/jsdoc-toolkit/app/lib/JSDOC.js $ 6 @name JSDOC.js 7 */ 8 9 /** 10 * @namespace 11 * JsDoc Toolkitアプリケーションの中核となるオブジェクト群を内包する名前空間です。 12 * <p class="org_comment"> 13 * This is the main container for the JSDOC application. 14 * </p> 15 */ 16 JSDOC = { 17 }; 18 19 if (typeof arguments == "undefined") arguments = []; 20 21 /** 22 * optプロパティは無名オブジェクトで、プロパティとしてコマンドラインオプションの設定値を持っています。 <br> 23 * プロパティ名はコンフィグファイルで使用されている名称と同じで、 24 * ユーザが設定した入力ファイルパスは"_"プロパティに配列としてセットされています。 25 * また"srcFiles"プロパティには、JsDoc Toolkitがそれをパースした全ソースファイルのリストが配列としてセットされています。 26 * @type Object 27 * @requires Opt 28 */ 29 JSDOC.opt = Opt.get( 30 arguments, 31 { 32 a: "allfunctions", 33 c: "conf", 34 d: "directory", 35 "D[]": "define", 36 e: "encoding", 37 "E[]": "exclude", 38 h: "help", 39 n: "nocode", 40 o: "out", 41 p: "private", 42 q: "quiet", 43 r: "recurse", 44 S: "securemodules", 45 s: "suppress", 46 t: "template", 47 T: "testmode", 48 u: "unique", 49 v: "verbose", 50 x: "ext" 51 } 52 ); 53 54 /** 55 * アプリケーションの現在のバージョンを表します。 56 * <p class="org_comment">The current version string of this application.</p> 57 * @final @type String 58 */ 59 JSDOC.VERSION = "2.3.2"; 60 61 /** 62 * 使用方法を出力し、アプリケーションを終了します。 63 * <p class="org_comment">Print out usage information and quit.</p> 64 */ 65 JSDOC.usage = function() { 66 print("USAGE: java -jar jsrun.jar app/run.js [OPTIONS] <SRC_DIR> <SRC_FILE> ..."); 67 print(""); 68 print("OPTIONS:"); 69 print(" -a or --allfunctions\n Include all functions, even undocumented ones.\n"); 70 print(" -c or --conf\n Load a configuration file.\n"); 71 print(" -d=<PATH> or --directory=<PATH>\n Output to this directory (defaults to \"out\").\n"); 72 print(" -D=\"myVar:My value\" or --define=\"myVar:My value\"\n Multiple. Define a variable, available in JsDoc as JSDOC.opt.D.myVar.\n"); 73 print(" -e=<ENCODING> or --encoding=<ENCODING>\n Use this encoding to read and write files.\n"); 74 print(" -E=\"REGEX\" or --exclude=\"REGEX\"\n Multiple. Exclude files based on the supplied regex.\n"); 75 print(" -h or --help\n Show this message and exit.\n"); 76 print(" -n or --nocode\n Ignore all code, only document comments with @name tags.\n"); 77 print(" -o=<PATH> or --out=<PATH>\n Print log messages to a file (defaults to stdout).\n"); 78 print(" -p or --private\n Include symbols tagged as private, underscored and inner symbols.\n"); 79 print(" -q or --quiet\n Do not output any messages, not even warnings.\n"); 80 print(" -r=<DEPTH> or --recurse=<DEPTH>\n Descend into src directories.\n"); 81 print(" -s or --suppress\n Suppress source code output.\n"); 82 print(" -S or --securemodules\n Use Secure Modules mode to parse source code.\n"); 83 print(" -t=<PATH> or --template=<PATH>\n Required. Use this template to format the output.\n"); 84 print(" -T or --test\n Run all unit tests and exit.\n"); 85 print(" -u or --unique\n Force file names to be unique, but not based on symbol names.\n"); 86 print(" -v or --verbose\n Provide verbose feedback about what is happening.\n"); 87 print(" -x=<EXT>[,EXT]... or --ext=<EXT>[,EXT]...\n Scan source files with the given extension/s (defaults to js).\n"); 88 89 quit(); 90 } 91 92 /*t: 93 plan(4, "Testing JSDOC namespace."); 94 95 is( 96 typeof JSDOC, 97 "object", 98 "JSDOC.usage is a function." 99 ); 100 101 is( 102 typeof JSDOC.VERSION, 103 "string", 104 "JSDOC.VERSION is a string." 105 ); 106 107 is( 108 typeof JSDOC.usage, 109 "function", 110 "JSDOC.usage is a function." 111 ); 112 113 is( 114 typeof JSDOC.opt, 115 "object", 116 "JSDOC.opt is a object." 117 ); 118 */ 119 120 if (this.IO) IO.includeDir("lib/JSDOC/"); 121