add main.Version

This commit is contained in:
ShuheiKubota 2019-11-09 15:29:48 +09:00
parent 200a67cd7b
commit beaa07bf03
1 changed files with 11 additions and 1 deletions

12
vvin.go
View File

@ -6,6 +6,7 @@ import (
"os"
"strings"
"syscall"
"time"
"unsafe"
"github.com/mitchellh/go-ps"
@ -13,6 +14,15 @@ import (
"github.com/shu-go/rog"
)
// Version is app version
var Version string
func init() {
if Version == "" {
Version = "dev-" + time.Now().Format("20060102")
}
}
type globalCmd struct {
Target string `cli:"target,t=WINDOW_TITLE" help:"default to current window"`
Debug bool
@ -159,7 +169,7 @@ func main() {
app := gli.NewWith(&globalCmd{})
app.Name = "vvin"
app.Desc = ""
app.Version = "0.0.0"
app.Version = Version
app.Usage = ``
app.Copyright = "(C) 2019 Shuhei Kubota"
app.Run(os.Args)