Mono.Documentation.MDoc.Run C# (CSharp) Méthode

Run() private méthode

private Run ( string args ) : void
args string
Résultat void
		private void Run (string[] args)
		{
			subcommands = new Dictionary<string, MDocCommand> () {
				{ "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 () },
			};

			bool showVersion = false;
			bool showHelp    = false;
			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 },
				new ResponseFileSource (),
			};

			var extra = p.Parse (args);

			if (showVersion) {
				Console.WriteLine ("mdoc {0}", Consts.MonoVersion);
				return;
			}
			if (extra.Count == 0) {
				Console.WriteLine ("Use `mdoc help' for usage.");
				return;
			}
			if (showHelp) {
				extra.Add ("--help");
			}
			switch (extra [0]) {
				case "x-msitomsx":
					new MsidocToMsxdocConverter ().Run (extra);
					break;
				default: 
					GetCommand (extra [0]).Run (extra);
					break;
			}
		}

Usage Example

Exemple #1
0
		private static void Main (string[] args)
		{
			MDoc d = new MDoc ();
			try {
				d.Run (args);
			}
			catch (Exception e) {
				if (debug) {
					Console.Error.WriteLine ("mdoc: {0}", e.ToString ());
				}
				else {
					Console.Error.WriteLine ("mdoc: {0}", e.Message);
				}
				Console.Error.WriteLine ("See `mdoc help' for more information.");
			}
		}
All Usage Examples Of Mono.Documentation.MDoc::Run