Compose records in arg parser (#234)

This commit is contained in:
Patrick Stevens
2024-09-04 00:04:23 +01:00
committed by GitHub
parent 86b938c81e
commit 2220f88053
9 changed files with 1334 additions and 301 deletions

View File

@@ -93,3 +93,38 @@ type DatesAndTimes =
[<InvariantCulture ; ParseExact @"hh\:mm\:ss">]
InvariantExact : TimeSpan
}
type ChildRecord =
{
Thing1 : int
Thing2 : string
}
[<ArgParser true>]
type ParentRecord =
{
Child : ChildRecord
AndAnother : bool
}
type ChildRecordWithPositional =
{
Thing1 : int
[<PositionalArgs>]
Thing2 : string list
}
[<ArgParser true>]
type ParentRecordChildPos =
{
Child : ChildRecordWithPositional
AndAnother : bool
}
[<ArgParser true>]
type ParentRecordSelfPos =
{
Child : ChildRecord
[<PositionalArgs>]
AndAnother : bool list
}