task: add exit task as the default task

pull/7/head
oscarzhou 2022-12-26 20:54:17 +13:00
parent a0e852feab
commit d3056fc0c9
2 changed files with 1 additions and 2 deletions

View File

@ -20,8 +20,6 @@ func main() {
tasks.NewCurlLookupTask(), tasks.NewCurlLookupTask(),
tasks.NewCodeSecurityScanTask(), tasks.NewCodeSecurityScanTask(),
tasks.NewListDevToolCommandTask(config), tasks.NewListDevToolCommandTask(config),
tasks.NewExitTask(),
} }
tasks.ListCommandMenu(taskItems, "Which repository of action do you want operate:") tasks.ListCommandMenu(taskItems, "Which repository of action do you want operate:")

View File

@ -14,6 +14,7 @@ type Tasker interface {
// ListCommandMenu iterates task items to display them // on the screen as the menu options // ListCommandMenu iterates task items to display them // on the screen as the menu options
func ListCommandMenu(taskItems []Tasker, menuDesp string) error { func ListCommandMenu(taskItems []Tasker, menuDesp string) error {
taskItems = append(taskItems, NewExitTask())
for { for {
printMainMenu := func() { printMainMenu := func() {
taskNames := []string{} taskNames := []string{}