Files
atomctl/cmd/gen.go
2025-09-10 20:16:11 +08:00

27 lines
500 B
Go

package cmd
import "github.com/spf13/cobra"
func CommandGen(root *cobra.Command) {
cmd := &cobra.Command{
Use: "gen",
Short: "Generate code",
PersistentPostRunE: commandFmtE,
}
cmd.PersistentFlags().StringP("config", "c", "config.toml", "database config file")
cmds := []func(*cobra.Command){
CommandGenProvider,
CommandGenRoute,
CommandGenModel,
CommandGenEnum,
CommandGenService,
}
for _, c := range cmds {
c(cmd)
}
root.AddCommand(cmd)
}