only sort keys left
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
8158a66db5
commit
ba981d6bb2
3
argv.go
3
argv.go
|
@ -9,7 +9,8 @@ package main
|
|||
var argv args
|
||||
|
||||
type args struct {
|
||||
Base string `arg:"--base" help:"basename"`
|
||||
LoBase string `arg:"--lobase" help:"lowercase basename"`
|
||||
UpBase string `arg:"--upbase" help:"uppercase basename"`
|
||||
Proto string `arg:"--proto" help:"the .proto filename"`
|
||||
}
|
||||
|
||||
|
|
16
main.go
16
main.go
|
@ -18,12 +18,6 @@ var BUILDTIME string
|
|||
func main() {
|
||||
pp := arg.MustParse(&argv)
|
||||
|
||||
// for very new users or users unfamilar with the command line, this may help them
|
||||
if argv.Base == "help" || argv.Base == "?" {
|
||||
pp.WriteHelp(os.Stdout)
|
||||
os.Exit(-1)
|
||||
}
|
||||
|
||||
// you need a proto file
|
||||
if argv.Proto == "" {
|
||||
log.Info("you must provide --proto <filename>")
|
||||
|
@ -40,6 +34,12 @@ func main() {
|
|||
os.Exit(-1)
|
||||
}
|
||||
|
||||
// you need --upbase and --lobase
|
||||
if argv.UpBase == "" {
|
||||
pp.WriteHelp(os.Stdout)
|
||||
os.Exit(-1)
|
||||
}
|
||||
|
||||
cmd := []string{"go", "list", "-f", "'{{.Name}}'"}
|
||||
result := shell.Run(cmd)
|
||||
|
||||
|
@ -54,9 +54,9 @@ func main() {
|
|||
|
||||
sortmap := make(map[string]string)
|
||||
sortmap["package"] = packageName
|
||||
sortmap["base"] = "gitTag"
|
||||
sortmap["base"] = argv.LoBase
|
||||
sortmap["lock"] = sortmap["base"] + "slock"
|
||||
sortmap["Base"] = "GitTag"
|
||||
sortmap["Base"] = argv.UpBase
|
||||
sortmap["Bases"] = sortmap["Base"] + "s"
|
||||
|
||||
sortmap["sortBy"] = "ByPath"
|
||||
|
|
|
@ -6,7 +6,7 @@ test: vet
|
|||
all: clean test.pb.go run goimports vet
|
||||
|
||||
run:
|
||||
../autogenpb --proto test.proto
|
||||
../autogenpb --proto test.proto --lobase gitTag --upbase GitTag
|
||||
|
||||
vet:
|
||||
@GO111MODULE=off go vet
|
||||
|
|
Loading…
Reference in New Issue