comparison trunk/src/main.d @ 771:ef9bee5a2d61

Command 'generate' can print line numbers now.
author Aziz K?ksal <aziz.koeksal@gmail.com>
date Mon, 18 Feb 2008 02:53:37 +0100
parents bc812843603c
children 78be32e3e157
comparison
equal deleted inserted replaced
770:26d8ed59806d 771:ef9bee5a2d61
115 cmd.DDoc.execute(filePaths, destination, macroPaths, incUndoc, verbose, infoMan); 115 cmd.DDoc.execute(filePaths, destination, macroPaths, incUndoc, verbose, infoMan);
116 infoMan.hasInfo && printErrors(infoMan); 116 infoMan.hasInfo && printErrors(infoMan);
117 break; 117 break;
118 case "gen", "generate": 118 case "gen", "generate":
119 char[] fileName; 119 char[] fileName;
120 DocOption options = DocOption.Tokens; 120 GenOption options = GenOption.Tokens;
121 foreach (arg; args[2..$]) 121 foreach (arg; args[2..$])
122 { 122 {
123 switch (arg) 123 switch (arg)
124 { 124 {
125 case "--syntax": 125 case "--syntax":
126 options |= DocOption.Syntax; break; 126 options |= GenOption.Syntax; break;
127 case "--xml": 127 case "--xml":
128 options |= DocOption.XML; break; 128 options |= GenOption.XML; break;
129 case "--html": 129 case "--html":
130 options |= DocOption.HTML; break; 130 options |= GenOption.HTML; break;
131 case "--lines":
132 options |= GenOption.PrintLines; break;
131 default: 133 default:
132 fileName = arg; 134 fileName = arg;
133 } 135 }
134 } 136 }
135 if (!(options & (DocOption.XML | DocOption.HTML))) 137 if (!(options & (GenOption.XML | GenOption.HTML)))
136 options |= DocOption.XML; // Default to XML. 138 options |= GenOption.XML; // Default to XML.
137 cmd.Generate.execute(fileName, options, infoMan); 139 cmd.Generate.execute(fileName, options, infoMan);
138 infoMan.hasInfo && printErrors(infoMan); 140 infoMan.hasInfo && printErrors(infoMan);
139 break; 141 break;
140 case "importgraph", "igraph": 142 case "importgraph", "igraph":
141 string filePath; 143 string filePath;
378 380
379 Example: 381 Example:
380 dil d doc/ src/main.d mymacros.ddoc -i`; 382 dil d doc/ src/main.d mymacros.ddoc -i`;
381 break; 383 break;
382 case "gen", "generate": 384 case "gen", "generate":
383 msg = GetMsg(MID.HelpGenerate); 385 // msg = GetMsg(MID.HelpGenerate);
386 msg = `Generate an XML or HTML document from a D source file.
387 Usage:
388 dil gen file.d [Options]
389
390 Options:
391 --syntax : generate tags for the syntax tree
392 --xml : use XML format (default)
393 --html : use HTML format
394 --lines : print line numbers
395
396 Example:
397 dil gen Parser.d --html --syntax > Parser.html`;
384 break; 398 break;
385 case "importgraph", "igraph": 399 case "importgraph", "igraph":
386 // msg = GetMsg(MID.HelpImportGraph); 400 // msg = GetMsg(MID.HelpImportGraph);
387 msg = `Parse a module and build a module dependency graph based on its imports. 401 msg = `Parse a module and build a module dependency graph based on its imports.
388 Usage: 402 Usage: