Mercurial > projects > dil
comparison trunk/src/main.d @ 800:dcd30b0ba711
Added --xml option to command 'ddoc'.
author | Aziz K?ksal <aziz.koeksal@gmail.com> |
---|---|
date | Sat, 01 Mar 2008 17:58:23 +0100 |
parents | c24be8d4f6ab |
children |
comparison
equal
deleted
inserted
replaced
799:fd719161e743 | 800:dcd30b0ba711 |
---|---|
106 | 106 |
107 auto destination = args[2]; | 107 auto destination = args[2]; |
108 auto macroPaths = GlobalSettings.ddocFilePaths; | 108 auto macroPaths = GlobalSettings.ddocFilePaths; |
109 char[][] filePaths; | 109 char[][] filePaths; |
110 bool incUndoc; | 110 bool incUndoc; |
111 bool writeXML; | |
111 bool verbose; | 112 bool verbose; |
112 // Parse arguments. | 113 // Parse arguments. |
113 auto context = newCompilationContext(); | 114 auto context = newCompilationContext(); |
114 foreach (arg; args[3..$]) | 115 foreach (arg; args[3..$]) |
115 { | 116 { |
116 if (parseDebugOrVersion(arg, context)) | 117 if (parseDebugOrVersion(arg, context)) |
117 {} | 118 {} |
119 else if (arg == "--xml") | |
120 writeXML = true; | |
118 else if (arg == "-i") | 121 else if (arg == "-i") |
119 incUndoc = true; | 122 incUndoc = true; |
120 else if (arg == "-v") | 123 else if (arg == "-v") |
121 verbose = true; | 124 verbose = true; |
122 else if (arg.length > 5 && icompare(arg[$-4..$], "ddoc") == 0) | 125 else if (arg.length > 5 && icompare(arg[$-4..$], "ddoc") == 0) |
125 filePaths ~= arg; | 128 filePaths ~= arg; |
126 } | 129 } |
127 | 130 |
128 infoMan = new InfoManager(); | 131 infoMan = new InfoManager(); |
129 // Execute command. | 132 // Execute command. |
130 cmd.DDoc.execute(filePaths, destination, macroPaths, incUndoc, verbose, context, infoMan); | 133 cmd.DDoc.execute(filePaths, destination, macroPaths, writeXML, |
134 incUndoc, verbose, context, infoMan); | |
131 infoMan.hasInfo && printErrors(infoMan); | 135 infoMan.hasInfo && printErrors(infoMan); |
132 break; | 136 break; |
133 case "gen", "generate": | 137 case "gen", "generate": |
134 char[] fileName; | 138 char[] fileName; |
135 GenOption options = GenOption.Tokens; | 139 GenOption options = GenOption.Tokens; |
301 // parse(args[2]); | 305 // parse(args[2]); |
302 // break; | 306 // break; |
303 case "?", "help": | 307 case "?", "help": |
304 printHelp(args.length >= 3 ? args[2] : ""); | 308 printHelp(args.length >= 3 ? args[2] : ""); |
305 break; | 309 break; |
310 // case "typerules": | |
311 // genHTMLTypeRulesTables(); | |
312 // break; | |
306 default: | 313 default: |
307 } | 314 } |
308 } | 315 } |
309 | 316 |
310 char[] readStdin() | 317 char[] readStdin() |
446 | 453 |
447 Destination is the folder where the documentation files are written to. | 454 Destination is the folder where the documentation files are written to. |
448 Files with the extension .ddoc are recognized as macro definition files. | 455 Files with the extension .ddoc are recognized as macro definition files. |
449 | 456 |
450 Options: | 457 Options: |
458 --xml : write XML instead of HTML documents | |
451 -i : include undocumented symbols | 459 -i : include undocumented symbols |
452 -v : verbose output | 460 -v : verbose output |
453 | 461 |
454 Example: | 462 Example: |
455 dil d doc/ src/main.d src/macros_dil.ddoc -i`; | 463 dil d doc/ src/main.d src/macros_dil.ddoc -i`; |