From 00f95b42385d7313a31500917483da655286e488 Mon Sep 17 00:00:00 2001 From: Sparky6 Date: Fri, 26 May 2023 23:41:42 +0200 Subject: [PATCH] csharp-s6ts --- csharp/mDoc/Program.cs | 55 +++++++++++++++++++++++-------------- debian/mdoc-tools.changelog | 5 +++- 2 files changed, 39 insertions(+), 21 deletions(-) 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 - -- 2.20.1