*: determine version from git

This commit is contained in:
Eric Chiang
2016-08-09 14:38:09 -07:00
parent b8e80ffa3a
commit e6f34e1051
4 changed files with 36 additions and 21 deletions

View File

@@ -10,9 +10,12 @@ import (
func commandVersion() *cobra.Command {
return &cobra.Command{
Use: "version",
Use: "version",
Short: "Print the version and exit",
Run: func(cmd *cobra.Command, args []string) {
fmt.Printf(`v%s %s %s %s
fmt.Printf(`dex Version:%s
Go Version: %s
Go OS/ARCH: %s %s
`, version.Version, runtime.Version(), runtime.GOOS, runtime.GOARCH)
},
}