From d231f076590849f839cf501672b3dcf72d31f632 Mon Sep 17 00:00:00 2001 From: Robin Olsen Date: Tue, 17 Feb 2026 13:35:27 +0100 Subject: [PATCH] check if arg --- cmd/survey/cmd.go | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/cmd/survey/cmd.go b/cmd/survey/cmd.go index 1b51fb2..fdbdaa7 100644 --- a/cmd/survey/cmd.go +++ b/cmd/survey/cmd.go @@ -32,16 +32,21 @@ func runStartCmd(cmd *cobra.Command, args []string) error { defer cleanup() surveyTasks := initTasks(svc) - interfaces := initInterfaces() - if args[0] == "tui" { - interfaces = []task.Interface{tui.NewTui()} - } - if args[0] == "repl" { - interfaces = []task.Interface{repl.NewRepl()} - } - if args[0] == "web" { - interfaces = []task.Interface{web.NewWeb()} + interfaces := []task.Interface{} + + if len(args) == 0 { + interfaces = initInterfaces() + } else { + if args[0] == "tui" { + interfaces = []task.Interface{tui.NewTui()} + } + if args[0] == "repl" { + interfaces = []task.Interface{repl.NewRepl()} + } + if args[0] == "web" { + interfaces = []task.Interface{web.NewWeb()} + } } if err := taskLoop(cmd.Context(), surveyTasks, interfaces); err != nil {