Initial commit

This commit is contained in:
Zhongwei Li
2025-11-30 08:37:58 +08:00
commit f0a4617f0c
38 changed files with 4166 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
package cmd
import (
"fmt"
"github.com/spf13/cobra"
)
var (
version = "dev"
commit = "unknown"
date = "unknown"
)
// versionCmd represents the version command
var versionCmd = &cobra.Command{
Use: "version",
Short: "Print version information",
Long: `Print the version, commit hash, and build date of this application.`,
Run: func(cmd *cobra.Command, args []string) {
fmt.Printf("{{PROJECT_NAME}} %s (commit: %s, built: %s)\n", version, commit, date)
},
}
func init() {
rootCmd.AddCommand(versionCmd)
}