remove onstart handler thing in favor of the user doing that themselves

This commit is contained in:
adman
2026-03-20 22:10:40 +01:00
parent 33cec6ecc9
commit 254b75e76b
14 changed files with 110 additions and 343 deletions
+6 -3
View File
@@ -28,21 +28,24 @@ func Help(args []string) (err error) {
}
func mainE() (err error) {
slog.SetLogLoggerLevel(slog.LevelDebug)
subcommands["help"] = Help // this is here because if it isn't tools/cli/main.go:17:5: initialization cycle for subcommands
// tools/cli/main.go:17:5: subcommands refers to Help
// tools/cli/main.go:22:6: Help refers to subcommands
args := os.Args
args = []string{"TEST", "status", "-addr", "tcpshield.1f2d.net:25565"}
if len(os.Args) < 2 {
if len(args) < 2 {
err = ExpectedASubcommandErr
return
}
f, ok := subcommands[os.Args[1]]
f, ok := subcommands[args[1]]
if !ok {
err = UnknownSubcommandErr
return
}
err = f(os.Args[2:])
err = f(args[2:])
return
}