refactor to use app package instead of service
refactor app to be composable
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
package surveyCmd
|
||||
package survey
|
||||
|
||||
import "github.com/spf13/cobra"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package surveyCmd
|
||||
package survey
|
||||
|
||||
import (
|
||||
"github.com/LazyBachelor/LazyPM/pkg/task"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package surveyCmd
|
||||
package survey
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package surveyCmd
|
||||
package survey
|
||||
|
||||
import (
|
||||
"github.com/LazyBachelor/LazyPM/internal/utils"
|
||||
"github.com/LazyBachelor/LazyPM/internal/utils/shellcomp"
|
||||
"github.com/LazyBachelor/LazyPM/pkg/task"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
@@ -20,6 +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", utils.CompletionFunc(task.ListTasks()))
|
||||
StartCmd.RegisterFlagCompletionFunc("interface", utils.CompletionFunc(task.ListInterfaces()))
|
||||
StartCmd.RegisterFlagCompletionFunc("task", shellcomp.CompletionFunc(task.ListTasks()))
|
||||
StartCmd.RegisterFlagCompletionFunc("interface", shellcomp.CompletionFunc(task.ListInterfaces()))
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package surveyCmd
|
||||
package survey
|
||||
|
||||
import (
|
||||
"github.com/LazyBachelor/LazyPM/internal/commands/issues"
|
||||
@@ -14,7 +14,7 @@ var StatusCmd = &cobra.Command{
|
||||
}
|
||||
|
||||
func runStatusCmd(cmd *cobra.Command, args []string) error {
|
||||
app := issuesCmd.AppFromContext(cmd.Context())
|
||||
app := issues.AppFromContext(cmd.Context())
|
||||
if app == nil || app.CurrentFeedback == nil {
|
||||
cmd.Println("No validation status available.")
|
||||
return nil
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package surveyCmd
|
||||
package survey
|
||||
|
||||
import "github.com/spf13/cobra"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user