fix: template

This commit is contained in:
Rogee
2024-12-21 00:25:12 +08:00
parent 58450dd63d
commit 6f04023a42
7 changed files with 26 additions and 20 deletions

View File

@@ -16,9 +16,10 @@ import (
func CommandGenEnum(root *cobra.Command) {
cmd := &cobra.Command{
Use: "enum",
Short: "Generate enums",
RunE: commandGenEnumE,
Use: "enum",
Aliases: []string{"e"},
Short: "Generate enums",
RunE: commandGenEnumE,
}
cmd.Flags().BoolP("flag", "f", true, "Flag enum values")

View File

@@ -19,9 +19,10 @@ import (
func CommandGenModel(root *cobra.Command) {
cmd := &cobra.Command{
Use: "model",
Short: "Generate jet models",
RunE: commandGenModelE,
Use: "model",
Aliases: []string{"m"},
Short: "Generate jet models",
RunE: commandGenModelE,
}
root.AddCommand(cmd)

View File

@@ -28,8 +28,9 @@ func getTypePkgName(typ string) string {
func CommandGenProvider(root *cobra.Command) {
cmd := &cobra.Command{
Use: "provider",
Short: "Generate providers",
Use: "provider",
Aliases: []string{"p"},
Short: "Generate providers",
Long: `
// @provider
// @provider:[except|only] [returnType] [group]

View File

@@ -14,8 +14,9 @@ import (
// migrate
func CommandMigrate(root *cobra.Command) {
cmd := &cobra.Command{
Use: "migrate [up|up-by-one|up-to|create|down|down-to|fix|redo|reset|status|version]",
RunE: commandMigrate,
Use: "migrate [up|up-by-one|up-to|create|down|down-to|fix|redo|reset|status|version]",
Aliases: []string{"m"},
RunE: commandMigrate,
}
cmd.Flags().StringP("config", "c", "config.toml", "database config file")

View File

@@ -18,10 +18,11 @@ import (
func CommandNewModule(root *cobra.Command) {
cmd := &cobra.Command{
Use: "module",
Short: "new module",
Args: cobra.ExactArgs(1),
RunE: commandNewModuleE,
Use: "module",
Aliases: []string{"m"},
Short: "new module",
Args: cobra.ExactArgs(1),
RunE: commandNewModuleE,
}
root.AddCommand(cmd)

View File

@@ -24,9 +24,10 @@ func isValidGoPackageName(name string) bool {
func CommandNewProject(root *cobra.Command) {
cmd := &cobra.Command{
Use: "project",
Short: "new project",
RunE: commandNewProjectE,
Use: "project",
Aliases: []string{"p"},
Short: "new project",
RunE: commandNewProjectE,
}
root.AddCommand(cmd)