version.go 537 B

12345678910111213141516171819202122232425262728
  1. package commands
  2. import (
  3. "fmt"
  4. "github.com/v2fly/v2ray-core/v4"
  5. "github.com/v2fly/v2ray-core/v4/commands/base"
  6. )
  7. // CmdVersion prints V2Ray Versions
  8. var CmdVersion = &base.Command{
  9. UsageLine: "{{.Exec}} version",
  10. Short: "Print V2Ray Versions",
  11. Long: `Version prints the build information for V2Ray executables.
  12. `,
  13. Run: executeVersion,
  14. }
  15. func executeVersion(cmd *base.Command, args []string) {
  16. printVersion()
  17. }
  18. func printVersion() {
  19. version := core.VersionStatement()
  20. for _, s := range version {
  21. fmt.Println(s)
  22. }
  23. }