using System;
using System.Collections.Generic;
using System.Diagnostics;
+using System.IO;
using System.Linq;
+using System.Text;
using Mono.Options;
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;
}
}
{ "assemble", new MDocAssembler () },
{ "dump-tree", new MDocTreeDumper () },
{ "export-html", new MDocToHtmlConverter () },
+ { "export-html-webdoc", new MDocExportWebdocHtml () },
{ "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;
{ "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.1.0");
+ Console.WriteLine ("mdoc {0}", Consts.MonoVersion);
return;
}
if (extra.Count == 0) {
- new MDocHelpCommand (this).Run (null);
+ Console.WriteLine ("Use `mdoc help' for usage.");
+ return;
}
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)