2020-11-25 14:01:53 +03:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
2020-12-04 04:36:16 +03:00
|
|
|
"github.com/xtls/xray-core/core"
|
|
|
|
"github.com/xtls/xray-core/main/commands/base"
|
2020-11-25 14:01:53 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
var cmdVersion = &base.Command{
|
|
|
|
UsageLine: "{{.Exec}} version",
|
|
|
|
Short: "Show current version of Xray",
|
|
|
|
Long: `Version prints the build information for Xray executables.
|
|
|
|
`,
|
|
|
|
Run: executeVersion,
|
|
|
|
}
|
|
|
|
|
|
|
|
func executeVersion(cmd *base.Command, args []string) {
|
|
|
|
printVersion()
|
|
|
|
}
|
|
|
|
|
|
|
|
func printVersion() {
|
|
|
|
version := core.VersionStatement()
|
|
|
|
for _, s := range version {
|
|
|
|
fmt.Println(s)
|
|
|
|
}
|
|
|
|
}
|