Files
atomctl/cmd/gen.go
Rogee f7504d57f9 g
2024-12-21 11:33:32 +08:00

26 lines
479 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,
}
for _, c := range cmds {
c(cmd)
}
root.AddCommand(cmd)
}