From: Sparky6 Date: Fri, 26 May 2023 21:41:42 +0000 (+0200) Subject: csharp-s6ts X-Git-Tag: mdoku_0.3-0~5 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=00f95b42385d7313a31500917483da655286e488;p=mDoc.git csharp-s6ts --- diff --git a/csharp/mDoc/Program.cs b/csharp/mDoc/Program.cs index 39110a2..419b75a 100644 --- a/csharp/mDoc/Program.cs +++ b/csharp/mDoc/Program.cs @@ -4,37 +4,52 @@ using System; using mDoc; class mDocMain{ - static int command_dispatch(string[] args) { + static int Main(string[] args) { + + Console.WriteLine("mdoc"); + string usage = "mdoc [options] "; // check runtime parameters - if (args.Length < 2) throw new ApplicationException("mdoc needs 2 arguments."); - + if (args.Length < 2) { + Console.WriteLine("mdoc needs 2 arguments."); + return 1; + } + + string opts; 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 "; + // define options + bool verbose = false; - if (argv.Length < 1) { - Console.WriteLine(usage); - return 1; - } + try{ + if (args.Length == 3) { + opts = args[0]; + file = args[1]; + template = args[2]; - try { - int ret = command_dispatch(argv); + // check options + if (opts[0] != '-') throw new ApplicationException("Options have to start with an '-'."); + for (int i=1; i Fri, 26 May 2023 16:54:48 +0100 + mdoc (0.1-%BUILD%) unstable; urgency=medium * C# port for mmailc -- Michael Wagner Fri, 30 Dec 2022 16:54:48 +0100 -