feat: 增强命令帮助文档,添加详细说明和示例
This commit is contained in:
17
cmd/gen.go
17
cmd/gen.go
@@ -3,11 +3,18 @@ package cmd
|
||||
import "github.com/spf13/cobra"
|
||||
|
||||
func CommandGen(root *cobra.Command) {
|
||||
cmd := &cobra.Command{
|
||||
Use: "gen",
|
||||
Short: "Generate code",
|
||||
PersistentPostRunE: commandFmtE,
|
||||
}
|
||||
cmd := &cobra.Command{
|
||||
Use: "gen",
|
||||
Short: "Generate code",
|
||||
Long: `代码生成命令组:包含 route、provider、model、enum、service 等。
|
||||
|
||||
持久化参数:
|
||||
- -c, --config 数据库配置文件(默认 config.toml),供 gen model 使用
|
||||
|
||||
说明:
|
||||
- 子命令执行完成后会自动运行 atomctl fmt 进行格式化`,
|
||||
PersistentPostRunE: commandFmtE,
|
||||
}
|
||||
cmd.PersistentFlags().StringP("config", "c", "config.toml", "database config file")
|
||||
|
||||
cmds := []func(*cobra.Command){
|
||||
|
||||
Reference in New Issue
Block a user