Hunter0x7c7
2022-08-11 a82f9cb69f63aaeba40c024960deda7d75b9fece
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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
}