add completions to survey

This commit is contained in:
Robin Olsen
2026-02-28 10:44:41 +01:00
parent 9ce9b6ee07
commit 8cdaf93f26
8 changed files with 47 additions and 35 deletions

View File

@@ -1,6 +1,10 @@
package surveyCmd
import "github.com/spf13/cobra"
import (
"github.com/LazyBachelor/LazyPM/internal/commands"
"github.com/LazyBachelor/LazyPM/pkg/task"
"github.com/spf13/cobra"
)
var (
InterfaceType string
@@ -16,4 +20,6 @@ var StartCmd = &cobra.Command{
func init() {
StartCmd.Flags().StringVarP(&Task, "task", "t", "", "Specify task.")
StartCmd.Flags().StringVarP(&InterfaceType, "interface", "i", "", "Specify interface.")
StartCmd.RegisterFlagCompletionFunc("task", commands.CompletionFunc(task.ListTasks()))
StartCmd.RegisterFlagCompletionFunc("interface", commands.CompletionFunc(task.ListInterfaces()))
}