main.go 639 B

1234567891011121314151617181920212223242526272829
  1. package main
  2. import (
  3. "github.com/v2fly/v2ray-core/v5/main/commands"
  4. "github.com/v2fly/v2ray-core/v5/main/commands/base"
  5. _ "github.com/v2fly/v2ray-core/v5/main/distro/all"
  6. )
  7. func main() {
  8. base.RootCommand.Long = "A unified platform for anti-censorship."
  9. base.RegisterCommand(commands.CmdRun)
  10. base.RegisterCommand(commands.CmdVersion)
  11. base.RegisterCommand(commands.CmdTest)
  12. base.SortLessFunc = runIsTheFirst
  13. base.SortCommands()
  14. base.Execute()
  15. }
  16. func runIsTheFirst(i, j *base.Command) bool {
  17. left := i.Name()
  18. right := j.Name()
  19. if left == "run" {
  20. return true
  21. }
  22. if right == "run" {
  23. return false
  24. }
  25. return left < right
  26. }