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