diff --git a/main.go b/main.go index 0c50cc0..d804f01 100644 --- a/main.go +++ b/main.go @@ -205,8 +205,17 @@ func main() { } } + filesToGenerate := map[string]struct{}{} + for _, file := range g.Request.FileToGenerate { + filesToGenerate[file] = struct{}{} + } + // Generate the encoders for _, file := range g.Request.GetProtoFile() { + // Ignore files not in g.Request.FileToGenerate. + if _, ok := filesToGenerate[*file.Name]; !ok { + continue + } if all { if singlePackageMode { if _, err = registry.LookupFile(file.GetName()); err != nil {