changeset 329:17f43b0d6106

- Renamed command highlight to generate. - Added message HelpGenerate. - Fix in getShortClassName(): added statement for removing package name.
author aziz
date Tue, 21 Aug 2007 19:44:03 +0000
parents 39f93a4ec416
children 44fc02d1eae6
files trunk/src/dil/Messages.d trunk/src/dil/Settings.d trunk/src/lang_de.d trunk/src/lang_en.d trunk/src/main.d
diffstat 5 files changed, 33 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/trunk/src/dil/Messages.d	Tue Aug 21 17:56:00 2007 +0000
+++ b/trunk/src/dil/Messages.d	Tue Aug 21 19:44:03 2007 +0000
@@ -60,6 +60,7 @@
 
   // Help messages:
   HelpMain,
+  HelpGenerate,
 }
 
 string GetMsg(MID mid)
--- a/trunk/src/dil/Settings.d	Tue Aug 21 17:56:00 2007 +0000
+++ b/trunk/src/dil/Settings.d	Tue Aug 21 19:44:03 2007 +0000
@@ -23,7 +23,7 @@
 const COMPILED_VERSION = Format!("%s.%s", __VERSION__/1000, __VERSION__%1000);
 const COMPILED_DATE = __TIMESTAMP__;
 
-const usageHighlight = "highlight (hl) file.d";
+const usageGenerate = "generate (gen)";
 
 struct GlobalSettings
 {
@@ -96,7 +96,7 @@
         }
       }
       if (messages.length != MID.max+1)
-        throw new Exception(std.string.format("messages table in %s must exactly have %d entries, but %s were found.", fileName, MID.max, messages.length));
+        throw new Exception(std.string.format("messages table in %s must exactly have %d entries, but %s were found.", fileName, MID.max+1, messages.length));
       GlobalSettings.messages = messages;
     }
   }
--- a/trunk/src/lang_de.d	Tue Aug 21 17:56:00 2007 +0000
+++ b/trunk/src/lang_de.d	Tue Aug 21 19:44:03 2007 +0000
@@ -64,5 +64,17 @@
 erhalten.
 
 Kompiliert mit {3} v{4} am {5}.
-`
+`,
+  `Generiere ein XML- oder HTML-Dokument aus einer D-Quelltextdatei.
+Verwendung:
+  dil gen datei.d [Optionen]
+
+Optionen:
+  --syntax         : generiere Elemente for die Syntax und Tokens
+  --xml            : verwende XML-Format (voreingestellt)
+  --html           : verwende HTML-Format
+
+Beispiel:
+  dil gen Parser.d --html --syntax > Parser.html
+`,
 ];
\ No newline at end of file
--- a/trunk/src/lang_en.d	Tue Aug 21 17:56:00 2007 +0000
+++ b/trunk/src/lang_en.d	Tue Aug 21 19:44:03 2007 +0000
@@ -63,5 +63,17 @@
 Type 'dil help <subcommand>' for more help on a particular subcommand.
 
 Compiled with {3} v{4} on {5}.
-`
+`,
+  `Generate an XML or HTML document from a D source file.
+Usage:
+  dil gen file.d [Options]
+
+Options:
+  --syntax         : generate tags for syntax and tokens
+  --xml            : use XML format
+  --html           : use HTML format
+
+Example:
+  dil gen Parser.d --html --syntax > Parser.html
+`,
 ];
\ No newline at end of file
--- a/trunk/src/main.d	Tue Aug 21 17:56:00 2007 +0000
+++ b/trunk/src/main.d	Tue Aug 21 19:44:03 2007 +0000
@@ -17,20 +17,18 @@
   GlobalSettings.load();
 
   if (args.length <= 1)
-    return writefln(format(MID.HelpMain, VERSION, usageHighlight, COMPILED_WITH, COMPILED_VERSION, COMPILED_DATE));
+    return writefln(format(MID.HelpMain, VERSION, usageGenerate, COMPILED_WITH, COMPILED_VERSION, COMPILED_DATE));
 
   string command = args[1];
   switch (command)
   {
-  case "hl", "highlight":
+  case "gen", "generate":
     char[] fileName;
-    DocOption options;
+    DocOption options = DocOption.Tokens;
     foreach (arg; args[2..$])
     {
       switch (arg)
       {
-      case "--tokens":
-        options |= DocOption.Tokens; break;
       case "--syntax":
         options |= DocOption.Syntax; break;
       case "--xml":
@@ -105,6 +103,7 @@
 {
   alias std.string.find find;
   char[] name = n.classinfo.name;
+  name = name[find(name, ".")+1 .. $]; // Remove package name
   name = name[find(name, ".")+1 .. $]; // Remove module name
   char[] remove;
   switch (n.category)