feat: version command
This commit is contained in:
@ -38,5 +38,6 @@ func initRootCmd() {
|
||||
logger := jlog.New(slog.LevelDebug)
|
||||
ctx := jlog.ContextWith(context.Background(), logger)
|
||||
|
||||
rootCmd.AddCommand(&versionCmd)
|
||||
rootCmd.AddCommand(getVerbs(ctx, &appConfig)...)
|
||||
}
|
||||
|
||||
16
cmd/version.go
Normal file
16
cmd/version.go
Normal file
@ -0,0 +1,16 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"git.bissendorf.co/bissendorf/unifood/m/v2/util"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var versionCmd = cobra.Command{
|
||||
Use: "version",
|
||||
Aliases: []string{"v"},
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
fmt.Println(util.AppVersion)
|
||||
},
|
||||
}
|
||||
3
util/version.go
Normal file
3
util/version.go
Normal file
@ -0,0 +1,3 @@
|
||||
package util
|
||||
|
||||
const AppVersion = "v0.1"
|
||||
Reference in New Issue
Block a user