2015-09-12 11:51:42 +02:00
|
|
|
package main
|
|
|
|
|
2015-09-12 20:36:21 +02:00
|
|
|
import (
|
2020-11-23 23:38:43 +08:00
|
|
|
"github.com/v2fly/v2ray-core/v4/main/commands"
|
2020-12-04 22:32:55 +08:00
|
|
|
"github.com/v2fly/v2ray-core/v4/main/commands/base"
|
2021-02-17 04:31:50 +08:00
|
|
|
_ "github.com/v2fly/v2ray-core/v4/main/distro/all"
|
2015-09-12 20:36:21 +02:00
|
|
|
)
|
|
|
|
|
2016-07-10 23:11:42 +02:00
|
|
|
func main() {
|
2020-11-23 23:38:43 +08:00
|
|
|
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
|
2018-12-04 14:15:35 +01:00
|
|
|
}
|
2020-11-23 23:38:43 +08:00
|
|
|
return left < right
|
2015-09-12 11:51:42 +02:00
|
|
|
}
|