Skip to content

Commit b4e01a4

Browse files
authored
Merge pull request #119 from ogen-go/feat/filename
feat: add filename arg
2 parents 86b7388 + 0430565 commit b4e01a4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cmd/protoc-gen-oas/main.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ func run() error {
2121
description := set.String("description", "", "Description")
2222
version := set.String("version", "", "Version")
2323
indent := set.Int("indent", 2, "Indent")
24+
filename := set.String("filename", "openapi", "Filename")
2425

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

53-
gf := plugin.NewGeneratedFile("openapi.yaml", "")
54+
gf := plugin.NewGeneratedFile(fmt.Sprintf("%s.yaml", *filename), "")
5455
if _, err := gf.Write(bytes); err != nil {
5556
return err
5657
}

0 commit comments

Comments
 (0)