示例#1
0
func bindOptions(flagSet *pflag.FlagSet, options *options) {
	flagSet.StringSliceVar(
		&options.GoModifiers,
		"go-modifier",
		[]string{},
		"Extra Mfile=package modifiers for --go_out, specify just as file=package to this flag.",
	)
	flagSet.StringVar(
		&options.GoPluginType,
		"go-plugin",
		"go",
		fmt.Sprintf("The go protoc plugin to use, allowed values are %s.", strings.Join(protoeasy.AllGoPluginTypeSimpleStrings(), ",")),
	)
	flagSet.StringSliceVar(
		&options.GogoModifiers,
		"gogo-modifier",
		[]string{},
		"Extra Mfile=package modifiers for --gogo_out, specify just as file=package to this flag.",
	)
	flagSet.StringVar(
		&options.GogoPluginType,
		"gogo-plugin",
		"gogofast",
		fmt.Sprintf("The gogo protoc plugin to use, allowed values are %s.", strings.Join(protoeasy.AllGogoPluginTypeSimpleStrings(), ",")),
	)
	flagSet.StringVar(
		&options.OutDirPath,
		"out",
		"",
		"Customize out directory path.",
	)
	flagSet.BoolVar(
		&options.NoFileCompileOptions,
		"no-file",
		false,
		fmt.Sprintf("Ignore any protoeasy options file (usually %s) and just use the flags for options", protoeasy.DefaultFileCompileOptionsFile),
	)
	flagSet.StringVarP(
		&options.FileCompileOptionsPath,
		"file",
		"f",
		protoeasy.DefaultFileCompileOptionsFile,
		`The file to check for to read protoeasy options from.
The path is relative to the input directory given as the first argument.
If file does not exist, just the flags will be used.
If the file exists, the file options will overwrite any passed flags unless --no-file is specified`,
	)
}
示例#2
0
文件: main.go 项目: sr/protoeasy
func bindOptions(flagSet *pflag.FlagSet, options *options) {
	flagSet.StringSliceVar(&options.GoModifiers, "go-modifier", []string{}, "Extra Mfile=package modifiers for --go_out, specify just as file=package to this flag.")
	flagSet.StringVar(&options.GoPluginType, "go-protoc-plugin", "go", fmt.Sprintf("The go protoc plugin to use, allowed values are %s, if not go, --go-no-default-modifiers is implied.", strings.Join(protoeasy.AllGoPluginTypeSimpleStrings(), ",")))
	flagSet.StringVar(&options.OutDirPath, "out", "", "Customize out directory path.")
}