github.com/v2fly/v2ray-core/v5@v5.16.2-0.20240507031116-8191faa6e095/main/main.go (about)

     1  package main
     2  
     3  import (
     4  	"github.com/v2fly/v2ray-core/v5/main/commands"
     5  	"github.com/v2fly/v2ray-core/v5/main/commands/base"
     6  	_ "github.com/v2fly/v2ray-core/v5/main/distro/all"
     7  )
     8  
     9  func main() {
    10  	base.RootCommand.Long = "A unified platform for anti-censorship."
    11  	base.RegisterCommand(commands.CmdRun)
    12  	base.RegisterCommand(commands.CmdVersion)
    13  	base.RegisterCommand(commands.CmdTest)
    14  	base.SortLessFunc = runIsTheFirst
    15  	base.SortCommands()
    16  	base.Execute()
    17  }
    18  
    19  func runIsTheFirst(i, j *base.Command) bool {
    20  	left := i.Name()
    21  	right := j.Name()
    22  	if left == "run" {
    23  		return true
    24  	}
    25  	if right == "run" {
    26  		return false
    27  	}
    28  	return left < right
    29  }