bedrocktool/utils/command_register.go

17 lines
252 B
Go
Raw Normal View History

2022-09-04 14:26:32 +00:00
package utils
2023-03-05 21:50:58 +00:00
import (
"github.com/google/subcommands"
)
2022-09-04 14:26:32 +00:00
2023-03-05 21:50:58 +00:00
var ValidCMDs = make(map[string]Command, 0)
2022-09-04 14:26:32 +00:00
2023-03-05 21:50:58 +00:00
type Command interface {
subcommands.Command
}
func RegisterCommand(sub Command) {
2022-09-04 14:26:32 +00:00
subcommands.Register(sub, "")
2023-03-05 21:50:58 +00:00
ValidCMDs[sub.Name()] = sub
2022-09-04 14:26:32 +00:00
}