1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-02-20 23:47:21 -05:00
v2fly/main/main.go
Jebbs 7c1ab06206
v5: Remove v2ctl & wv2ray (#488)
* remove v2ctl, wv2ray
* remove v2ctl, wv2ray build scripts
* remove infra/control/main
* remove !confonly flag
* remove ctlcmd package
* remove Confgi.Override func
* move commands package into main
2020-12-04 22:32:55 +08:00

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
}