Mercurial > projects > dil
changeset 740:f3dead0310ce
Added '-v' (verbose) option to command 'ddoc'.
author | Aziz K?ksal <aziz.koeksal@gmail.com> |
---|---|
date | Sat, 09 Feb 2008 15:10:13 +0100 |
parents | 49fe21aa387c |
children | 35184354a502 |
files | trunk/src/cmd/DDoc.d trunk/src/main.d |
diffstat | 2 files changed, 11 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/trunk/src/cmd/DDoc.d Sat Feb 09 14:24:35 2008 +0100 +++ b/trunk/src/cmd/DDoc.d Sat Feb 09 15:10:13 2008 +0100 @@ -31,7 +31,7 @@ import tango.io.FilePath; void execute(string[] filePaths, string destDir, string[] macroPaths, - bool incUndoc, InfoManager infoMan) + bool incUndoc, bool verbose, InfoManager infoMan) { // Parse macro files. MacroTable mtable; @@ -60,11 +60,12 @@ // Generate documentation. auto dest = new FilePath(destDir); - generateDocumentation(dest, mod, mtable, incUndoc); + generateDocumentation(dest, mod, mtable, incUndoc, verbose); } } -void generateDocumentation(FilePath dest, Module mod, MacroTable mtable, bool incUndoc) +void generateDocumentation(FilePath dest, Module mod, MacroTable mtable, + bool incUndoc, bool verbose) { // Create a macro environment for this module. mtable = new MacroTable(mtable); @@ -87,6 +88,8 @@ auto fileText = expandMacros(mtable, "$(DDOC)"); // Finally write the file out to the harddisk. dest.append(mod.getFQN() ~ ".html"); + if (verbose) + Stdout.formatln("{} > {}", mod.filePath, dest); auto file = new File(dest); file.write(fileText); }
--- a/trunk/src/main.d Sat Feb 09 14:24:35 2008 +0100 +++ b/trunk/src/main.d Sat Feb 09 15:10:13 2008 +0100 @@ -92,11 +92,14 @@ auto macroPaths = GlobalSettings.ddocFilePaths; char[][] filePaths; bool incUndoc; + bool verbose; // Parse arguments. foreach (arg; args[3..$]) { if (arg == "-i") incUndoc = true; + else if (arg == "-v") + verbose = true; else if (arg.length > 5 && toLower(arg[$-4..$].dup) == "ddoc") macroPaths ~= arg; else @@ -105,7 +108,7 @@ auto infoMan = new InfoManager(); // Execute command. - cmd.DDoc.execute(filePaths, destination, macroPaths, incUndoc, infoMan); + cmd.DDoc.execute(filePaths, destination, macroPaths, incUndoc, verbose, infoMan); if (infoMan.info.length) return printErrors(infoMan); break; @@ -348,6 +351,7 @@ Options: -i : include undocumented symbols + -v : verbose output Example: dil d doc/ src/main.d mymacros.ddoc -i`;