update repo

This commit is contained in:
ministicraft
2019-06-04 22:58:42 +02:00
parent b5a7116849
commit 8ed9113bb2
62 changed files with 3810 additions and 82 deletions

View File

@@ -0,0 +1,38 @@
package cmd
import (
"fmt"
"runtime"
"github.com/spf13/cobra"
)
var (
version = "dev"
commit = "I don't remember exactly"
date = "I don't remember exactly"
)
// versionCmd represents the version command
var versionCmd = &cobra.Command{
Use: "version",
Short: "Display version",
Run: func(cmd *cobra.Command, args []string) {
displayVersion(rootCmd.Name())
},
}
func init() {
rootCmd.AddCommand(versionCmd)
}
func displayVersion(name string) {
fmt.Printf(name+`:
version : %s
commit : %s
build date : %s
go version : %s
go compiler : %s
platform : %s/%s
`, version, commit, date, runtime.Version(), runtime.Compiler, runtime.GOOS, runtime.GOARCH)
}