v2fly/main/main.go

30 lines
591 B
Go

package main
import (
"v2ray.com/core/main/commands"
"v2ray.com/core/main/commands/base"
_ "v2ray.com/core/main/distro/all"
)
func main() {
base.RootCommand.Long = "A unified platform for anti-censorship."
base.RegisterCommand(commands.CmdRun)
base.RegisterCommand(commands.CmdVersion)
base.RegisterCommand(commands.CmdTest)
base.SortLessFunc = runIsTheFirst
base.SortCommands()
base.Execute()
}
func runIsTheFirst(i, j *base.Command) bool {
left := i.Name()
right := j.Name()
if left == "run" {
return true
}
if right == "run" {
return false
}
return left < right
}