package tasks

import (
	"ocl/portainer-devtool/configs"
	"ocl/portainer-devtool/tasks/subtasks"
)

type ListDevToolCommandTask struct {
	Config *configs.Config
}

func NewListDevToolCommandTask(cfg *configs.Config) *ListDevToolCommandTask {
	return &ListDevToolCommandTask{
		Config: cfg,
	}
}

func (task *ListDevToolCommandTask) Execute() error {
	subTaskItems := []Tasker{
		subtasks.NewListVolumeSubTask(task.Config),
		subtasks.NewListRepositorySubTask(task.Config),
	}

	ListCommandMenu(subTaskItems, "Which management commands do you want to choose:")

	return nil
}

func (task *ListDevToolCommandTask) String() string {
	return "List Dev Tool Commands"
}
