github.com/xraypb/xray-core@v1.6.6/main/version.go (about)

     1  package main
     2  
     3  import (
     4  	"fmt"
     5  
     6  	"github.com/xraypb/xray-core/core"
     7  	"github.com/xraypb/xray-core/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  }