autogenpb/argv.go

39 lines
1.2 KiB
Go
Raw Normal View History

package main
/*
this parses the command line arguements
this enables command line options from other packages like 'gui' and 'log'
*/
var argv args
type args struct {
2025-01-10 04:37:54 -06:00
Package string `arg:"--package" help:"the package name"`
Proto string `arg:"--proto" help:"the .proto filename"`
Mutex bool `arg:"--mutex" default:"true" help:"insert a mutex into protoc .pb.go file"`
Delete bool `arg:"--delete" help:"use delete with copy experiment"`
DryRun bool `arg:"--dry-run" help:"show what would be run"`
GoSrc string `arg:"--go-src" help:"default is ~/go/src. could be set to your go.work path"`
GoPath string `arg:"--gopath" help:"the gopath of this repo"`
Identify string `arg:"--identify" help:"identify file"`
}
func (a args) Description() string {
2025-01-10 04:22:53 -06:00
return "autogenpb " + VERSION + " Built on " + BUILDTIME + `
2025-01-10 04:22:53 -06:00
Auto Generate protocol buffer Sort() and Marshal() functions
2025-01-10 04:22:53 -06:00
go install go.wit.com/apps/autogenpb@latest
2025-01-10 04:22:53 -06:00
The protobuf requires a 'standard' .proto format.
See the git sources for an example .proto file.
`
}
2025-01-10 04:22:53 -06:00
/*
func (args) Version() string {
2025-01-10 04:22:53 -06:00
return "autogenpb " + VERSION + " Built on " + BUILDTIME
}
2025-01-10 04:22:53 -06:00
*/