diff --git a/Fsdk/Misc.fs b/Fsdk/Misc.fs index e10a31e..95cb353 100644 --- a/Fsdk/Misc.fs +++ b/Fsdk/Misc.fs @@ -83,8 +83,20 @@ module Misc = | OnlyFlags of seq | BothFlags of seq*string*seq - let ParseArgs (_args: array): ArgsParsed = - failwith "NIE" + let ParseArgs (args: array): ArgsParsed = + let rec innerFunc (theArgs: List) currentCount = + match theArgs with + | [] -> currentCount + | head::tail -> + if head.StartsWith "--" || head.StartsWith "-" then + innerFunc tail (currentCount + 1) + else + currentCount + + let revArgs = Array.rev args |> List.ofArray + let count = innerFunc revArgs 0 + let dummyList = [ for x in 0..count -> String.Empty ] |> Seq.ofList + ArgsParsed.OnlyFlags dummyList let FsxOnlyArguments() = let cmdLineArgs = Environment.GetCommandLineArgs() |> List.ofSeq