github.com/xmplusdev/xmcore@v1.8.11-0.20240412132628-5518b55526af/main/version.go (about)

     1  package main
     2  
     3  import (
     4  	"fmt"
     5  
     6  	"github.com/xmplusdev/xmcore/core"
     7  	"github.com/xmplusdev/xmcore/main/commands/base"
     8  )
     9  
    10  var cmdVersion = &base.Command{
    11  	UsageLine: "{{.Exec}} version",
    12  	Short:     "Show current version of Xray",
    13  	Long: `Version prints the build information for Xray executables.
    14  	`,
    15  	Run: executeVersion,
    16  }
    17  
    18  func executeVersion(cmd *base.Command, args []string) {
    19  	printVersion()
    20  }
    21  
    22  func printVersion() {
    23  	version := core.VersionStatement()
    24  	for _, s := range version {
    25  		fmt.Println(s)
    26  	}
    27  }