// See https://aka.ms/new-console-template for more information using System; using mDoc; class mDocMain{ static int command_dispatch(string[] args) { // check runtime parameters if (args.Length < 2) throw new ApplicationException("mdoc needs 2 arguments."); string file = args[0]; string template = args[1]; Worker w = new Worker(); return w.convert(file, template); } public static int Main(string[] argv){ Console.WriteLine("mdoc"); string usage = "mdoc "; if (argv.Length < 1) { Console.WriteLine(usage); return 1; } try { int ret = command_dispatch(argv); if (ret != 0) { Console.WriteLine(usage); } return ret; } catch (Exception e) { Console.WriteLine(e.ToString()); throw new Exception(e.ToString()); } } }