diff --git a/cmd/create/cmdflags.go b/cmd/create/cmdflags.go index 654e723..ad04a44 100644 --- a/cmd/create/cmdflags.go +++ b/cmd/create/cmdflags.go @@ -42,7 +42,7 @@ func AddCreateFlags(createCmd *cobra.Command) { createCmd.Flags().Bool("secvenabled", false, "Enable generation of validate.go file using protoc-gen-secv, defaults to false") createCmd.Flags().Bool("validate", false, - "Enable generation of validate.go file using protoc-gen-validate, defaults to false") + "Enable generation of validate.pb.go file using protoc-gen-validate, defaults to false") createCmd.Flags().String("kvfile", "", "Provide a json file path to unmarshal into key-value pairs (KVs) for usage in template files") createCmd.Flags().String("kvrawjson", "", diff --git a/cmd/create/generate.go b/cmd/create/generate.go index b9afe29..3b75bd1 100644 --- a/cmd/create/generate.go +++ b/cmd/create/generate.go @@ -358,7 +358,7 @@ func (g *genDependencyRPCStubParam) genDependencyRPCStubPB() error { searchPath, g.fname, g.option.Language, g.outputDir, append(opts, pb.WithSecvEnabled(true))..., ); err != nil { - return fmt.Errorf("generate validation file for %s err: %w", g.fname, err) + return fmt.Errorf("generate secv file for %s err: %w", g.fname, err) } } // Run protoc-gen-validate. diff --git a/util/pb/option.go b/util/pb/option.go index 9f5c245..84ee691 100644 --- a/util/pb/option.go +++ b/util/pb/option.go @@ -34,7 +34,7 @@ func WithSecvEnabled(enabled bool) Option { // https://github.com/bufbuild/protoc-gen-validate/tree/v1.0.2 func WithValidateEnabled(enabled bool) Option { return func(o *options) { - o.secvEnabled = enabled + o.validationEnabled = enabled } }