summaryrefslogtreecommitdiff
path: root/argv.custom.go
blob: 7a1a9d39d955024b44525b61194a4a1a244a088d (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
package main

import (
	"os"

	"go.wit.com/lib/protobuf/argvpb"
)

// are sent via -ldflags at buildtime
var VERSION string
var BUILDTIME string

// used for shell auto completion
var APPNAME string = "gowebd"

// sends the strings to bash or zsh that will be your options
func (a args) SendCompletionStrings(pb *argvpb.Argv) {
	if pb.GetCmd() == "" {
		base := []string{"test", "--version", "--force"}
		pb.SendStrings(base)
	} else {
		pb.SubCommand(pb.Goargs...)
	}
	os.Exit(0)
}