check if arg
This commit is contained in:
@@ -32,8 +32,12 @@ func runStartCmd(cmd *cobra.Command, args []string) error {
|
|||||||
defer cleanup()
|
defer cleanup()
|
||||||
|
|
||||||
surveyTasks := initTasks(svc)
|
surveyTasks := initTasks(svc)
|
||||||
interfaces := initInterfaces()
|
|
||||||
|
|
||||||
|
interfaces := []task.Interface{}
|
||||||
|
|
||||||
|
if len(args) == 0 {
|
||||||
|
interfaces = initInterfaces()
|
||||||
|
} else {
|
||||||
if args[0] == "tui" {
|
if args[0] == "tui" {
|
||||||
interfaces = []task.Interface{tui.NewTui()}
|
interfaces = []task.Interface{tui.NewTui()}
|
||||||
}
|
}
|
||||||
@@ -43,6 +47,7 @@ func runStartCmd(cmd *cobra.Command, args []string) error {
|
|||||||
if args[0] == "web" {
|
if args[0] == "web" {
|
||||||
interfaces = []task.Interface{web.NewWeb()}
|
interfaces = []task.Interface{web.NewWeb()}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if err := taskLoop(cmd.Context(), surveyTasks, interfaces); err != nil {
|
if err := taskLoop(cmd.Context(), surveyTasks, interfaces); err != nil {
|
||||||
return returnIfUserQuit(err, "task loop failed")
|
return returnIfUserQuit(err, "task loop failed")
|
||||||
|
|||||||
Reference in New Issue
Block a user