[runtime] Disable some tests in full-aot mode which cannot be AOTed because of type...
[mono.git] / mcs / tools / mdoc / Mono.Documentation / mdoc.cs
index a67178e20462665c4109f0f2a5dfb5dc039a50a4..207d6cb40f911ba5cda004fefb7b8665b655082d 100644 (file)
@@ -26,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;
                        }
                }
@@ -47,25 +47,21 @@ namespace Mono.Documentation {
                                { "update",           new MDocUpdater () },
                                { "update-ecma-xml",  new MDocUpdateEcmaXml () },
                                { "validate",         new MDocValidator () },
+                               { "index",            new MDocIndex () },
+                               { "preserve",         new MDocPreserve () }
                        };
 
                        bool showVersion = false;
                        bool showHelp    = false;
-                       var extra = new List<string> ();
                        var p = new OptionSet () {
                                { "version",  v => showVersion = v != null },
                                { "v:",       (int? v) => verbosity = v.HasValue ? v.Value : verbosity+1 },
                                { "debug",    v => debug = v != null },
                                { "h|?|help", v => showHelp = v != null },
-                               { "<>",       v => { 
-                                               if (v.Length > 0 && v [0] == '@')
-                                                       extra.AddRange (ReadResponseFile (v.Substring (1)));
-                                               else
-                                                       extra.Add (v);
-                               } },
+                               new ResponseFileSource (),
                        };
 
-                       p.Parse (args);
+                       var extra = p.Parse (args);
 
                        if (showVersion) {
                                Console.WriteLine ("mdoc {0}", Consts.MonoVersion);
@@ -88,52 +84,6 @@ namespace Mono.Documentation {
                        }
                }
 
-               // Cribbed from mcs/driver.cs:LoadArgs(string)
-               static IEnumerable<string> ReadResponseFile (string file)
-               {
-                       StreamReader response;
-                       try {
-                               response = File.OpenText (file);
-                       } catch {
-                               yield break;
-                       }
-
-                       using (response) {
-                               StringBuilder arg = new StringBuilder ();
-
-                               string line;
-                               while ((line = response.ReadLine ()) != null) {
-                                       int t = line.Length;
-
-                                       for (int i = 0; i < t; i++) {
-                                               char c = line [i];
-                                               
-                                               if (c == '"' || c == '\'') {
-                                                       char end = c;
-                                                       
-                                                       for (i++; i < t; i++){
-                                                               c = line [i];
-
-                                                               if (c == end)
-                                                                       break;
-                                                               arg.Append (c);
-                                                       }
-                                               } else if (c == ' ') {
-                                                       if (arg.Length > 0) {
-                                                               yield return arg.ToString ();
-                                                               arg.Length = 0;
-                                                       }
-                                               } else
-                                                       arg.Append (c);
-                                       }
-                                       if (arg.Length > 0) {
-                                               yield return arg.ToString ();
-                                               arg.Length = 0;
-                                       }
-                               }
-                       }
-               }
-
                internal MDocCommand GetCommand (string command)
                {
                        MDocCommand h;