You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I'm doing protoc-gen-X --help I would expect to have a little section about how I can configure buf to use this plugin, what are the different options available that I can pass in my buf.gen.yaml.
When I'm doing a protoc-gen-X --version I would expect the version to show up.
Could it be possible for protoplugin to implement interface that support all of that? Having validation that ensure that all options are documented could be really helpful as well :)
The text was updated successfully, but these errors were encountered:
// WithVersion returns a new RunOption that will result in the given version string being printed
// to stdout if the plugin is given the --version flag.
//
// This can be passed to Main or Run.
//
// The default is no version flag is installed.
funcWithVersion(versionstring) RunOption {
returnoptsFunc(func(opts*opts) {
opts.version=version
})
}
Regarding the first point on --help I think that's an interesting one because something I've always wanted in the Protobuf ecosystem is to have a common way to configure, view and retrieve available options (in a programmatic way). This is typically left to plugin maintainers to keep up-to-date in README or doc pages, and surely there's gotta be a better way.
protogen allows you to use a *flag.FlagSet, so you can have the same set of options be displayed in --help and used as Protobuf plugin options, e.g., --go_out=<param1>=<value1>
When I'm doing
protoc-gen-X --help
I would expect to have a little section about how I can configure buf to use this plugin, what are the different options available that I can pass in mybuf.gen.yaml
.When I'm doing a
protoc-gen-X --version
I would expect the version to show up.Could it be possible for protoplugin to implement interface that support all of that? Having validation that ensure that all options are documented could be really helpful as well :)
The text was updated successfully, but these errors were encountered: