Files
sunhpc-go/cmd/init/init.go
2026-02-15 07:18:14 +08:00

19 lines
467 B
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package initcmd
import (
"github.com/spf13/cobra"
)
// 仅定义 Cmd 注册子命令,只负责组装命令树,尽量不包含业务逻辑
var Cmd = &cobra.Command{
Use: "init",
Short: "初始化集群配置",
Long: "初始化 SunHPC 配置文件、数据库、系统参数及相关服务",
}
func init() {
// 注册所有子命令(通过工厂函数创建, 例如 DatabaseCmd()
Cmd.AddCommand(NewDatabaseCmd())
Cmd.AddCommand(NewConfigCmd())
}