diff --git a/Mutannot/Mutannot.fsproj b/Mutannot/Mutannot.fsproj
index 7c6381b..396d322 100644
--- a/Mutannot/Mutannot.fsproj
+++ b/Mutannot/Mutannot.fsproj
@@ -11,6 +11,7 @@
+
diff --git a/Mutannot/Program.fs b/Mutannot/Program.fs
index 15ba0f2..0153b3f 100644
--- a/Mutannot/Program.fs
+++ b/Mutannot/Program.fs
@@ -3,6 +3,7 @@ open System.IO
open System.Reflection
open System.Runtime.InteropServices
open Fli
+open Argu
type MutationCase = { TestName: string; Patch: string }
@@ -118,18 +119,26 @@ let getMutationCases projectPath =
| _ -> None))
|> Seq.toList
+type Arguments =
+ | [] ProjectPath of ProjectPath: string
+
+ interface IArgParserTemplate with
+ member s.Usage =
+ match s with
+ | ProjectPath _ -> "path/to/project.csproj|fsproj"
+
[]
let main argv =
- if argv.Length <> 1 then
- eprintf "Usage: mutannot \n"
- exit 1
+ let parsedArguments =
+ ArgumentParser.Create(programName = "mutannot")
+ |> _.ParseCommandLine(argv)
+
+ let projectPath = parsedArguments.GetResult ProjectPath
ensureCleanWorkingDirectory ()
AppDomain.CurrentDomain.ProcessExit.Add(fun _ -> restore ())
- let projectPath = argv[0]
-
for index, mutationCase in getMutationCases projectPath |> Seq.indexed do
Console.ForegroundColor <- ConsoleColor.Green
printf $"MUTATION {index + 1}\n"