mirror of
https://ghproxy.net/https://github.com/CaptainCore/captaincore.git
synced 2025-10-04 01:34:46 +08:00
21 lines
407 B
Go
21 lines
407 B
Go
package cmd
|
|
|
|
import (
|
|
"fmt"
|
|
"runtime"
|
|
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var versionCmd = &cobra.Command{
|
|
Use: "version",
|
|
Short: "Display version info",
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
version := "captaincore 0.13.0\n- go version: " + runtime.Version() + "\n- platform: " + runtime.GOOS + "/" + runtime.GOARCH
|
|
fmt.Println(version)
|
|
},
|
|
}
|
|
|
|
func init() {
|
|
rootCmd.AddCommand(versionCmd)
|
|
}
|