mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-11-09 19:58:45 -05:00
30 lines
639 B
Go
30 lines
639 B
Go
package main
|
|
|
|
import (
|
|
"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"
|
|
)
|
|
|
|
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
|
|
}
|