@@ -125,13 +125,13 @@ trait CLICommon extends GuardrailRunner {
125125 case (sofar :: already, " --models" :: xs) =>
126126 Continue ((empty.withKind(CodegenTarget .Models ) :: sofar :: already, xs))
127127 case (sofar :: already, " --framework" :: value :: xs) =>
128- Continue ((sofar.copyContext(framework = Some (value)) :: already, xs))
128+ Continue ((sofar.modifyContext(_.withFramework( Some (value) )) :: already, xs))
129129 case (sofar :: already, " --help" :: xs) =>
130130 Continue ((sofar.withPrintHelp(true ) :: already, List .empty))
131131 case (sofar :: already, " --specPath" :: value :: xs) =>
132132 Continue ((sofar.withSpecPath(Option (expandTilde(value))) :: already, xs))
133133 case (sofar :: already, " --tracing" :: xs) =>
134- Continue ((sofar.copyContext(tracing = true ) :: already, xs))
134+ Continue ((sofar.modifyContext(_.withTracing( true ) ) :: already, xs))
135135 case (sofar :: already, " --outputPath" :: value :: xs) =>
136136 Continue ((sofar.withOutputPath(Option (expandTilde(value))) :: already, xs))
137137 case (sofar :: already, " --packageName" :: value :: xs) =>
@@ -141,11 +141,11 @@ trait CLICommon extends GuardrailRunner {
141141 case (sofar :: already, " --import" :: value :: xs) =>
142142 Continue ((sofar.withImports(sofar.imports :+ value) :: already, xs))
143143 case (sofar :: already, " --module" :: value :: xs) =>
144- Continue ((sofar.copyContext(modules = sofar.context.modules :+ value) :: already, xs))
144+ Continue ((sofar.modifyContext(_.withModules( sofar.context.modules :+ value) ) :: already, xs))
145145 case (sofar :: already, " --custom-extraction" :: xs) =>
146- Continue ((sofar.copyContext(customExtraction = true ) :: already, xs))
146+ Continue ((sofar.modifyContext(_.withCustomExtraction( true ) ) :: already, xs))
147147 case (sofar :: already, " --package-from-tags" :: xs) =>
148- Continue ((sofar.copyContext(tagsBehaviour = TagsBehaviour .PackageFromTags ) :: already, xs))
148+ Continue ((sofar.modifyContext(_.withTagsBehaviour( TagsBehaviour .PackageFromTags ) ) :: already, xs))
149149 case (sofar :: already, (arg @ " --optional-encode-as" ) :: value :: xs) =>
150150 for {
151151 propertyRequirement <- parseOptionalProperty(arg.drop(2 ), value)
@@ -159,7 +159,7 @@ trait CLICommon extends GuardrailRunner {
159159 case (sofar :: already, (arg @ " --auth-implementation" ) :: value :: xs) =>
160160 for {
161161 auth <- parseAuthImplementation(arg, value)
162- res <- Continue ((sofar.copyContext(authImplementation = auth) :: already, xs))
162+ res <- Continue ((sofar.modifyContext(_.withAuthImplementation( auth) ) :: already, xs))
163163 } yield res
164164 case (_, unknown) =>
165165 debug(" Unknown argument" ) >> Bail (UnknownArguments (unknown))
0 commit comments