refactor to decouple commands form entrypoint for reusability and centralizing commands.

Increase reusability and composition
This commit is contained in:
Robin Olsen
2026-02-22 19:46:55 +01:00
parent 118e67dbf4
commit 33c8c05ae3
28 changed files with 305 additions and 282 deletions

View File

@@ -15,7 +15,7 @@ import (
// 3. Run the interface
// 4. Start validation loop in background
// 5. Show questionnaire when done
func RunTask(ctx context.Context, t Tasker, i Interface, ifaceType InterfaceType) error {
func RunTask(ctx context.Context, t Tasker, i Interface, iType InterfaceType) error {
doneChan := make(chan bool, 1)
quitChan := make(chan bool, 1)
feedbackChan := make(chan ValidationFeedback, 10)
@@ -65,7 +65,7 @@ func RunTask(ctx context.Context, t Tasker, i Interface, ifaceType InterfaceType
}
// Show questionnaire
questions := t.Questions(ifaceType)
questions := t.Questions(iType)
questionare := taskui.NewQuestionnaireModel(questions)
model, err = tea.NewProgram(questionare, tea.WithAltScreen()).Run()
if err != nil {