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 22, 2023
1 parent 758a1de commit 5d9f51c
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 @@ -83,8 +83,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 x in 0..count -> String.Empty ] |> Seq.ofList

Check warning on line 98 in Fsdk/Misc.fs

View workflow job for this annotation

GitHub Actions / macOS--dotnet6-and-mono

The value 'x' is unused

Check warning on line 98 in Fsdk/Misc.fs

View workflow job for this annotation

GitHub Actions / macOS--dotnet6-and-mono

The value 'x' is unused

Check warning on line 98 in Fsdk/Misc.fs

View workflow job for this annotation

GitHub Actions / macOS--dotnet6-and-mono

The value 'x' is unused

Check warning on line 98 in Fsdk/Misc.fs

View workflow job for this annotation

GitHub Actions / macOS--dotnet6-and-mono

The value 'x' is unused

Check warning on line 98 in Fsdk/Misc.fs

View workflow job for this annotation

GitHub Actions / macOS--dotnet6-and-mono

The value 'x' is unused

Check warning on line 98 in Fsdk/Misc.fs

View workflow job for this annotation

GitHub Actions / macOS--dotnet6-and-mono

The value 'x' is unused

Check warning on line 98 in Fsdk/Misc.fs

View workflow job for this annotation

GitHub Actions / windows--dotnet6

The value 'x' is unused

Check warning on line 98 in Fsdk/Misc.fs

View workflow job for this annotation

GitHub Actions / windows--dotnet6

The value 'x' is unused

Check warning on line 98 in Fsdk/Misc.fs

View workflow job for this annotation

GitHub Actions / windows--dotnet6

The value 'x' is unused

Check warning on line 98 in Fsdk/Misc.fs

View workflow job for this annotation

GitHub Actions / windows--dotnet6

The value 'x' is unused

Check warning on line 98 in Fsdk/Misc.fs

View workflow job for this annotation

GitHub Actions / windows--dotnet6

The value 'x' is unused

Check warning on line 98 in Fsdk/Misc.fs

View workflow job for this annotation

GitHub Actions / windows--dotnet6

The value 'x' is unused
ArgsParsed.OnlyFlags dummyList

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

0 comments on commit 5d9f51c

Please sign in to comment.