add version information
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log/slog"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var (
|
||||
version = "unset"
|
||||
commit = "unset"
|
||||
date = "unset"
|
||||
)
|
||||
|
||||
var versionCmd = &cobra.Command{
|
||||
Use: "version",
|
||||
Short: "Show Kontor Version",
|
||||
Long: "Show Kontor Version",
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
slog.Info("version kontor")
|
||||
fmt.Println("Version: ", version)
|
||||
fmt.Println("Version: ", commit)
|
||||
fmt.Println("Version: ", date)
|
||||
},
|
||||
}
|
||||
|
||||
func init() {
|
||||
rootCmd.AddCommand(versionCmd)
|
||||
}
|
||||
@@ -1,7 +1,11 @@
|
||||
package globals
|
||||
|
||||
var Secret = []byte("secret")
|
||||
var (
|
||||
Secret = []byte("secret")
|
||||
|
||||
Version = "0.4.0"
|
||||
Commit = "unset"
|
||||
Date = "unset"
|
||||
)
|
||||
|
||||
const UserKey = "user"
|
||||
|
||||
const Version = "0.4.0"
|
||||
|
||||
Reference in New Issue
Block a user