From 20399f2da7d5987e75690558627c51a13a77649f Mon Sep 17 00:00:00 2001 From: Jarl Gullberg Date: Mon, 26 Jun 2017 21:01:30 +0200 Subject: [PATCH] Added option parsing to the main program. --- src/Generator.Rewrite/Generator.Rewrite.csproj | 1 + src/Generator.Rewrite/Program.cs | 10 ++++------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/Generator.Rewrite/Generator.Rewrite.csproj b/src/Generator.Rewrite/Generator.Rewrite.csproj index 3834892e..518e5ae0 100644 --- a/src/Generator.Rewrite/Generator.Rewrite.csproj +++ b/src/Generator.Rewrite/Generator.Rewrite.csproj @@ -59,6 +59,7 @@ + diff --git a/src/Generator.Rewrite/Program.cs b/src/Generator.Rewrite/Program.cs index f028ff37..02c44cb1 100644 --- a/src/Generator.Rewrite/Program.cs +++ b/src/Generator.Rewrite/Program.cs @@ -18,7 +18,7 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; - +using CommandLine; using Mono.Cecil; using Mono.Cecil.Cil; using Mono.Cecil.Rocks; @@ -29,14 +29,12 @@ namespace OpenTK.Rewrite // with the s IL instructions. internal class Program { + private static readonly Options Options = new Options(); + private static void Main(string[] args) { - if (args.Length == 0) + if (!Parser.Default.ParseArguments(args, Options)) { - Console.WriteLine("Usage: rewrite [file.dll] [file.snk] [options]"); - Console.WriteLine("[options] is:"); - Console.WriteLine(" -debug (enable calls to GL.GetError())"); - Console.WriteLine(" -dllimport (force calls to use DllImport instead of GetProcAddress)"); return; }