diff --git a/WoofWare.Myriad.Plugins/MyriadParamParser.fs b/WoofWare.Myriad.Plugins/MyriadParamParser.fs index 82c4e3b..d18def3 100644 --- a/WoofWare.Myriad.Plugins/MyriadParamParser.fs +++ b/WoofWare.Myriad.Plugins/MyriadParamParser.fs @@ -2,28 +2,6 @@ namespace WoofWare.Myriad.Plugins open System.Collections.Generic -type internal DesiredGenerator = - | InterfaceMock of isInternal : bool option - | JsonParse of extensionMethod : bool option - | JsonSerialize of extensionMethod : bool option - | HttpClient of extensionMethod : bool option - - static member Parse (s : string) = - match s with - | "GenerateMock" -> DesiredGenerator.InterfaceMock None - | "GenerateMock(true)" -> DesiredGenerator.InterfaceMock (Some true) - | "GenerateMock(false)" -> DesiredGenerator.InterfaceMock (Some false) - | "JsonParse" -> DesiredGenerator.JsonParse None - | "JsonParse(true)" -> DesiredGenerator.JsonParse (Some true) - | "JsonParse(false)" -> DesiredGenerator.JsonParse (Some false) - | "JsonSerialize" -> DesiredGenerator.JsonSerialize None - | "JsonSerialize(true)" -> DesiredGenerator.JsonSerialize (Some true) - | "JsonSerialize(false)" -> DesiredGenerator.JsonSerialize (Some false) - | "HttpClient" -> DesiredGenerator.HttpClient None - | "HttpClient(true)" -> DesiredGenerator.HttpClient (Some true) - | "HttpClient(false)" -> DesiredGenerator.HttpClient (Some false) - | _ -> failwith $"Failed to parse as a generator specification: %s{s}" - [] module internal MyriadParamParser = (* diff --git a/WoofWare.Myriad.Plugins/Parameters.fs b/WoofWare.Myriad.Plugins/Parameters.fs new file mode 100644 index 0000000..9fc9b31 --- /dev/null +++ b/WoofWare.Myriad.Plugins/Parameters.fs @@ -0,0 +1,23 @@ +namespace WoofWare.Myriad.Plugins + +type internal DesiredGenerator = + | InterfaceMock of isInternal : bool option + | JsonParse of extensionMethod : bool option + | JsonSerialize of extensionMethod : bool option + | HttpClient of extensionMethod : bool option + + static member Parse (s : string) = + match s with + | "GenerateMock" -> DesiredGenerator.InterfaceMock None + | "GenerateMock(true)" -> DesiredGenerator.InterfaceMock (Some true) + | "GenerateMock(false)" -> DesiredGenerator.InterfaceMock (Some false) + | "JsonParse" -> DesiredGenerator.JsonParse None + | "JsonParse(true)" -> DesiredGenerator.JsonParse (Some true) + | "JsonParse(false)" -> DesiredGenerator.JsonParse (Some false) + | "JsonSerialize" -> DesiredGenerator.JsonSerialize None + | "JsonSerialize(true)" -> DesiredGenerator.JsonSerialize (Some true) + | "JsonSerialize(false)" -> DesiredGenerator.JsonSerialize (Some false) + | "HttpClient" -> DesiredGenerator.HttpClient None + | "HttpClient(true)" -> DesiredGenerator.HttpClient (Some true) + | "HttpClient(false)" -> DesiredGenerator.HttpClient (Some false) + | _ -> failwith $"Failed to parse as a generator specification: %s{s}" diff --git a/WoofWare.Myriad.Plugins/WoofWare.Myriad.Plugins.fsproj b/WoofWare.Myriad.Plugins/WoofWare.Myriad.Plugins.fsproj index af29d92..f7e5f26 100644 --- a/WoofWare.Myriad.Plugins/WoofWare.Myriad.Plugins.fsproj +++ b/WoofWare.Myriad.Plugins/WoofWare.Myriad.Plugins.fsproj @@ -31,6 +31,7 @@ +