V2bX/cmd/version.go

36 lines
773 B
Go
Raw Normal View History

package cmd
import (
"fmt"
"strings"
2023-07-29 07:27:15 -04:00
vCore "github.com/InazumaV/V2bX/core"
"github.com/spf13/cobra"
)
var (
version = "TempVersion" //use ldflags replace
codename = "V2bX"
intro = "A V2board backend based on multi core"
)
var versionCommand = cobra.Command{
Use: "version",
Short: "Print version info",
Run: func(_ *cobra.Command, _ []string) {
showVersion()
},
}
func init() {
command.AddCommand(&versionCommand)
}
func showVersion() {
fmt.Printf("%s %s (%s) \n", codename, version, intro)
fmt.Printf("Supported cores: %s\n", strings.Join(vCore.RegisteredCore(), ", "))
// Warning
fmt.Println(Warn("This version need V2board version >= 1.7.0."))
2023-07-23 06:49:07 -04:00
fmt.Println(Warn("The version have many changed for config, please check your config file"))
}