This commit is contained in:
2026-02-15 07:18:14 +08:00
parent d7cd899983
commit 8a7bf8a39c
39 changed files with 1578 additions and 2868 deletions

View File

@@ -4,6 +4,7 @@ import (
"github.com/spf13/cobra"
)
// 仅定义 Cmd 注册子命令,只负责组装命令树,尽量不包含业务逻辑
var Cmd = &cobra.Command{
Use: "init",
Short: "初始化集群配置",
@@ -11,7 +12,7 @@ var Cmd = &cobra.Command{
}
func init() {
Cmd.AddCommand(configCmd)
Cmd.AddCommand(systemCmd)
Cmd.AddCommand(serviceCmd)
// 注册所有子命令(通过工厂函数创建, 例如 DatabaseCmd()
Cmd.AddCommand(NewDatabaseCmd())
Cmd.AddCommand(NewConfigCmd())
}