Skip to content

Commit

Permalink
Fsdk/Misc.fs: make recently added test pass
Browse files Browse the repository at this point in the history
  • Loading branch information
knocte committed Aug 23, 2023
1 parent 92d48de commit 98e938b
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions Fsdk/Misc.fs
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,20 @@ module Misc =
| OnlyFlags of seq<string>
| BothFlags of seq<string>*string*seq<string>

let ParseArgs (_args: array<string>): ArgsParsed =
failwith "NIE"
let ParseArgs (args: array<string>): ArgsParsed =
let rec innerFunc (theArgs: List<string>) 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 _dummyItem in 0 .. (count - 1) -> String.Empty ] |> Seq.ofList
ArgsParsed.OnlyFlags dummyList

let FsxOnlyArguments() =
let cmdLineArgs = Environment.GetCommandLineArgs() |> List.ofSeq
Expand Down

0 comments on commit 98e938b

Please sign in to comment.