summaryrefslogtreecommitdiff
path: root/internal/askcli/dispatch.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-06-18 08:05:32 +0300
committerPaul Buetow <paul@buetow.org>2026-06-18 08:05:32 +0300
commita80ad2b4691d0df63f68c6977ee18444e7bb752f (patch)
tree6edc47fcc3c929856826432cf3df3394a14934e8 /internal/askcli/dispatch.go
parent4ffb22e7f69f1c9c79b095d4e60bad3d97aac55b (diff)
ik0 replace remaining test seams with DI
Diffstat (limited to 'internal/askcli/dispatch.go')
-rw-r--r--internal/askcli/dispatch.go20
1 files changed, 13 insertions, 7 deletions
diff --git a/internal/askcli/dispatch.go b/internal/askcli/dispatch.go
index cdfc1d8..c1976f1 100644
--- a/internal/askcli/dispatch.go
+++ b/internal/askcli/dispatch.go
@@ -20,10 +20,13 @@ type Runner interface {
// uses the real time.Ticker-backed factory installed by NewDispatcher; tests
// inject a fake ticker so they can drive the watch loop without real delays.
type Dispatcher struct {
- runner Runner
- jsonOutput bool
- newTicker func(time.Duration) watchTicker
- capture func(context.Context, []byte) (string, error)
+ runner Runner
+ jsonOutput bool
+ newTicker func(time.Duration) watchTicker
+ capture func(context.Context, []byte) (string, error)
+ aliasCache taskAliasCacheDeps
+ findTaskBinary func() (string, error)
+ runTaskCommand taskCommandRunner
}
// NewDispatcher creates a Dispatcher backed by the provided Runner or a default
@@ -35,9 +38,12 @@ func NewDispatcher(runner Runner) *Dispatcher {
runner = &e
}
return &Dispatcher{
- runner: runner,
- newTicker: newRealWatchTicker,
- capture: editorCapture,
+ runner: runner,
+ newTicker: newRealWatchTicker,
+ capture: editorCapture,
+ aliasCache: defaultTaskAliasCacheDeps(),
+ findTaskBinary: findTaskBinary,
+ runTaskCommand: runTaskCommand,
}
}