Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
Notable changes are recorded here.

# WoofWare.Myriad.Plugins 10.1.1

Fixes a number of bugs in the `ArgParserGenerator` by extracting the "untyped" logic into a standalone module.
The generated code changes substantially, but the only behaviour changes you should observe are correctness fixes.

# WoofWare.Myriad.Plugins 10.0.1

The `JsonSerializeGenerator` now requires `System.Text.Json` at version at least 8, to accommodate `JsonNode.DeepClone`.
Expand Down
124 changes: 0 additions & 124 deletions ConsumePlugin/ArgParserConflictTests.fs

This file was deleted.

36 changes: 36 additions & 0 deletions ConsumePlugin/Args.fs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,23 @@ type ParentRecord =
AndAnother : bool
}

type ChildRecordWithDefault =
{
[<ArgumentDefaultFunction>]
FromFunction : Choice<int, int>
}

/// The default-function convention resolves against the record which declares the field,
/// not against the [<ArgParser>]-tagged root.
static member DefaultFromFunction () = 97

[<ArgParser true>]
type ParentRecordChildDefault =
{
Child : ChildRecordWithDefault
AndAnother : bool
}

type ChildRecordWithPositional =
{
Thing1 : int
Expand Down Expand Up @@ -191,6 +208,17 @@ type ManyLongForms =
SomeFlag : bool
}

[<ArgParser true>]
type AliasedPositionals =
{
Count : int

[<PositionalArgs>]
[<ArgumentLongForm "rest">]
[<ArgumentLongForm "remainder">]
Others : string list
}

[<RequireQualifiedAccess>]
type private IrrelevantDu =
| Foo
Expand Down Expand Up @@ -259,3 +287,11 @@ type WithMultilineTypeHelp =
OutputDir : string
Force : bool
}

/// Regression test: the pre-rewrite generator produced uncompilable code for a non-positional
/// list of booleans (its accumulator was a ResizeArray but the flag machinery assumed an option).
[<ArgParser>]
type NonPositionalBoolList =
{
Flags : bool list
}
11 changes: 4 additions & 7 deletions ConsumePlugin/ConsumePlugin.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -100,17 +100,14 @@
<Compile Include="GeneratedArgParserNegationTests.fs">
<MyriadFile>ArgParserNegationTests.fs</MyriadFile>
</Compile>
<Compile Include="Nested/Args.fs" />
<Compile Include="Nested/GeneratedArgs.fs">
<MyriadFile>Nested/Args.fs</MyriadFile>
</Compile>
<Compile Include="OpensLeakRegression.fs" />
<Compile Include="GeneratedOpensLeakRegression.fs">
<MyriadFile>OpensLeakRegression.fs</MyriadFile>
</Compile>
<!-- Not compiled, because by design they *don't* compile. That makes them very hard to test in an automated way! -->
<None Include="ArgParserConflictTests.fs" />
<!-- To run the conflict tests:
<Compile Include="GeneratedArgParserConflictTests.fs">
<MyriadFile>ArgParserConflictTests.fs</MyriadFile>
</Compile>
-->
<None Include="swagger-gitea.json" />
<Compile Include="GeneratedSwaggerGitea.fs">
<MyriadFile>swagger-gitea.json</MyriadFile>
Expand Down
Loading
Loading