X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mDoc.git/blobdiff_plain/e4c79811c1113982d25cf1744ed4dc0950758e9c..93ce61f94d2ffef218be47197f569fb6c9268baa:/csharp/mDoc/Program.cs diff --git a/csharp/mDoc/Program.cs b/csharp/mDoc/Program.cs new file mode 100644 index 0000000..39110a2 --- /dev/null +++ b/csharp/mDoc/Program.cs @@ -0,0 +1,40 @@ +// 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()); + } + } +}