Skip to content

Commit d69e4c4

Browse files
committed
add NewProceduralRunnerCommand
1 parent de1aa9b commit d69e4c4

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

runner.go

+42
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,48 @@ func NewRunnerCommand(use string) *cobra.Command {
6767
return genCmd
6868
}
6969

70+
// Procedural runner command
71+
// name: the prefix of the scene/screen
72+
// usecases
73+
// config path
74+
func NewProceduralRunnerCommand(use string) *cobra.Command {
75+
76+
var name string
77+
var usecasesString string
78+
var configFilePath string
79+
80+
genCmd := &cobra.Command{
81+
Use: use,
82+
Short: "generate source & unit tests files",
83+
Run: func(cmd *cobra.Command, args []string) {
84+
85+
fmt.Println("Please enter the prefix of the scene/screen.")
86+
fmt.Println("example: ArticleDetail or ChatList or UserList and so on")
87+
fmt.Print("insert: ")
88+
fmt.Scanln(&name)
89+
90+
fmt.Println("\nPlease enter usecases")
91+
fmt.Println("example: Fetch,Delete,Update")
92+
fmt.Print("insert: ")
93+
fmt.Scanln(&usecasesString)
94+
95+
fmt.Println("\nPlease enter the config file")
96+
fmt.Println("example: ./some_path/some_config.yaml")
97+
fmt.Print("insert: ")
98+
fmt.Scanln(&configFilePath)
99+
100+
run(
101+
name,
102+
usecasesString,
103+
"", // unused
104+
"", // unused
105+
configFilePath,
106+
)
107+
},
108+
}
109+
return genCmd
110+
}
111+
70112
func run(
71113
name string,
72114
usecasesString string,

0 commit comments

Comments
 (0)