Merge pull request #2034 from alexrp/ctx-cleanup
[mono.git] / mcs / tools / mdoc / Mono.Documentation / mdoc.cs
index 99bb9247f1bc247f6b7a8b9348dbeb0b8a6f56ca..207d6cb40f911ba5cda004fefb7b8665b655082d 100644 (file)
@@ -2,7 +2,9 @@
 using System;
 using System.Collections.Generic;
 using System.Diagnostics;
+using System.IO;
 using System.Linq;
+using System.Text;
 using Mono.Options;
 
 namespace Mono.Documentation {
@@ -24,7 +26,7 @@ namespace Mono.Documentation {
                                else {
                                        Console.Error.WriteLine ("mdoc: {0}", e.Message);
                                }
-                               Console.Error.WriteLine ("See `mdoc help' for more information.");
+                               Console.Error.WriteLine ("See `mdoc help' for more information or use --debug to diagnose.");
                                Environment.ExitCode = 1;
                        }
                }
@@ -43,7 +45,10 @@ namespace Mono.Documentation {
                                { "export-msxdoc",    new MDocToMSXDocConverter () },
                                { "help",             new MDocHelpCommand (this) },
                                { "update",           new MDocUpdater () },
+                               { "update-ecma-xml",  new MDocUpdateEcmaXml () },
                                { "validate",         new MDocValidator () },
+                               { "index",            new MDocIndex () },
+                               { "preserve",         new MDocPreserve () }
                        };
 
                        bool showVersion = false;
@@ -53,9 +58,10 @@ namespace Mono.Documentation {
                                { "v:",       (int? v) => verbosity = v.HasValue ? v.Value : verbosity+1 },
                                { "debug",    v => debug = v != null },
                                { "h|?|help", v => showHelp = v != null },
+                               new ResponseFileSource (),
                        };
 
-                       List<string> extra = p.Parse (args);
+                       var extra = p.Parse (args);
 
                        if (showVersion) {
                                Console.WriteLine ("mdoc {0}", Consts.MonoVersion);
@@ -68,7 +74,14 @@ namespace Mono.Documentation {
                        if (showHelp) {
                                extra.Add ("--help");
                        }
-                       GetCommand (extra [0]).Run (extra);
+                       switch (extra [0]) {
+                               case "x-msitomsx":
+                                       new MsidocToMsxdocConverter ().Run (extra);
+                                       break;
+                               default: 
+                                       GetCommand (extra [0]).Run (extra);
+                                       break;
+                       }
                }
 
                internal MDocCommand GetCommand (string command)