feat: init commit

This commit is contained in:
krau
2024-10-10 23:31:01 +08:00
commit 1cbcebc148
31 changed files with 1673 additions and 0 deletions

18
cmd/version.go Normal file
View File

@@ -0,0 +1,18 @@
package cmd
import (
"fmt"
"runtime"
"github.com/krau/SaveAny-Bot/common"
"github.com/spf13/cobra"
)
var VersionCmd = &cobra.Command{
Use: "version",
Aliases: []string{"v"},
Short: "Print the version number of saveany-bot",
Run: func(cmd *cobra.Command, args []string) {
fmt.Printf("saveany-bot version: %s %s/%s\nBuildTime: %s, Commit: %s\n", common.Version, runtime.GOOS, runtime.GOARCH, common.BuildTime, common.GitCommit)
},
}