feat: add gen model
This commit is contained in:
21
cmd/gen.go
Normal file
21
cmd/gen.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package cmd
|
||||
|
||||
import "github.com/spf13/cobra"
|
||||
|
||||
func CommandGen(root *cobra.Command) {
|
||||
cmd := &cobra.Command{
|
||||
Use: "gen",
|
||||
Short: "Generate code",
|
||||
}
|
||||
cmd.PersistentFlags().StringP("config", "c", "config.toml", "database config file")
|
||||
|
||||
cmds := []func(*cobra.Command){
|
||||
CommandGenModel,
|
||||
}
|
||||
|
||||
for _, c := range cmds {
|
||||
c(cmd)
|
||||
}
|
||||
|
||||
root.AddCommand(cmd)
|
||||
}
|
||||
Reference in New Issue
Block a user