We have released Buf v0.31.0.
This changes the
--file flag to
--path. This flag is used to filter the actual Protobuf files built under an input. For example, with
buf generate, this allows only generating stubs for a subset of your input:
# Only generate for the files in the directories proto/foo and proto/bar
$ buf generate --path proto/foo --path proto/bar
# Only generate for the files proto/foo/foo.proto and proto/foo/bar.proto
$ buf generate --path proto/foo/foo.proto --path proto/foo/bar.proto
# Only generate for the files in the directory proto/foo on your GitHub repository
$ buf generate --template buf.gen.yaml https://github.com/foo/bar.git --path proto/foo
Note that the --file flag continues to work, but prints a deprecation message.
This flag is available on the following commands:
- buf build
- buf check breaking
- buf check lint
- buf generate
This flag will also be available on the upcoming buf format command, stay tuned!