From 235275d911ac0d8c0620166ca068c67d6ee59a7c Mon Sep 17 00:00:00 2001 From: Robin Olsen Date: Tue, 17 Feb 2026 13:02:24 +0100 Subject: [PATCH] add so u can choose interface --- cmd/survey/cmd.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/cmd/survey/cmd.go b/cmd/survey/cmd.go index 280bab9..1b51fb2 100644 --- a/cmd/survey/cmd.go +++ b/cmd/survey/cmd.go @@ -1,6 +1,10 @@ package main import ( + "github.com/LazyBachelor/LazyPM/pkg/cli/repl" + "github.com/LazyBachelor/LazyPM/pkg/task" + "github.com/LazyBachelor/LazyPM/pkg/tui" + "github.com/LazyBachelor/LazyPM/pkg/web" "github.com/spf13/cobra" ) @@ -13,6 +17,7 @@ var startCmd = &cobra.Command{ Use: "start", Short: "Start the user survey", RunE: runStartCmd, + Args: cobra.MinimumNArgs(0), } func runStartCmd(cmd *cobra.Command, args []string) error { @@ -29,6 +34,16 @@ func runStartCmd(cmd *cobra.Command, args []string) error { 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()} + } + if err := taskLoop(cmd.Context(), surveyTasks, interfaces); err != nil { return returnIfUserQuit(err, "task loop failed") }