Added option parsing to the main program.

This commit is contained in:
Jarl Gullberg 2017-06-26 21:01:30 +02:00
parent 3cb9c5f833
commit 20399f2da7
No known key found for this signature in database
GPG key ID: 750FF6F6BDA72D23
2 changed files with 5 additions and 6 deletions

View file

@ -59,6 +59,7 @@
<ItemGroup> <ItemGroup>
<Compile Include="CountAttribute.cs" /> <Compile Include="CountAttribute.cs" />
<Compile Include="GeneratedVariableIdentifier.cs" /> <Compile Include="GeneratedVariableIdentifier.cs" />
<Compile Include="Options.cs" />
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup> </ItemGroup>

View file

@ -18,7 +18,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using CommandLine;
using Mono.Cecil; using Mono.Cecil;
using Mono.Cecil.Cil; using Mono.Cecil.Cil;
using Mono.Cecil.Rocks; using Mono.Cecil.Rocks;
@ -29,14 +29,12 @@ namespace OpenTK.Rewrite
// with the s IL instructions. // with the s IL instructions.
internal class Program internal class Program
{ {
private static readonly Options Options = new Options();
private static void Main(string[] args) 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; return;
} }