summaryrefslogtreecommitdiff
path: root/argv.go
blob: 676e67ec0e0b55f3293a7e80112f91a946f5a6bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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 {
	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 {
	return "autogenpb " + VERSION + "    Built on " + BUILDTIME + `

Auto Generate protocol buffer Sort() and Marshal() functions

go install go.wit.com/apps/autogenpb@latest

The protobuf requires a 'standard' .proto format.
See the git sources for an example .proto file.
`
}

/*
func (args) Version() string {
	return "autogenpb " + VERSION + "    Built on " + BUILDTIME
}
*/