Skip to content

Commit

Permalink
Merge pull request #119 from ogen-go/feat/filename
Browse files Browse the repository at this point in the history
feat: add filename arg
  • Loading branch information
tdakkota authored Oct 19, 2023
2 parents 86b7388 + 0430565 commit b4e01a4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/protoc-gen-oas/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ func run() error {
description := set.String("description", "", "Description")
version := set.String("version", "", "Version")
indent := set.Int("indent", 2, "Indent")
filename := set.String("filename", "openapi", "Filename")

if err := set.Parse(os.Args[1:]); err != nil {
return errors.Wrap(err, "parse args")
Expand Down Expand Up @@ -50,7 +51,7 @@ func run() error {
return err
}

gf := plugin.NewGeneratedFile("openapi.yaml", "")
gf := plugin.NewGeneratedFile(fmt.Sprintf("%s.yaml", *filename), "")
if _, err := gf.Write(bytes); err != nil {
return err
}
Expand Down

0 comments on commit b4e01a4

Please sign in to comment.