X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mDoc.git/blobdiff_plain/93ce61f94d2ffef218be47197f569fb6c9268baa..aee1145219ae5b5fcf6c2a1947db85b21c2f4da8:/csharp/mDoc/Program.cs 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