Skip to content

Commit

Permalink
Compose records in arg parser (#234)
Browse files Browse the repository at this point in the history
  • Loading branch information
Smaug123 authored Sep 3, 2024
1 parent 86b938c commit 2220f88
Show file tree
Hide file tree
Showing 9 changed files with 1,334 additions and 301 deletions.
1 change: 1 addition & 0 deletions .fantomasignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.direnv/
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
Notable changes are recorded here.

# WoofWare.Myriad.Plugins 2.2.1, WoofWare.Myriad.Plugins.Attributes 3.2.1

New generator: `ArgParser`, a basic reflection-free argument parser.

# WoofWare.Myriad.Plugins 2.1.45, WoofWare.Myriad.Plugins.Attributes 3.1.7

The NuGet packages are now attested to through [GitHub Attestations](https://github.blog/2024-05-02-introducing-artifact-attestations-now-in-public-beta/).
Expand Down
35 changes: 35 additions & 0 deletions ConsumePlugin/Args.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Loading

0 comments on commit 2220f88

Please sign in to comment.