diff options
| author | Paul Buetow <paul@buetow.org> | 2026-03-27 11:33:33 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-03-27 11:33:33 +0200 |
| commit | f57ccb885d20c48e1dae65b8ad5c46375b9a11a9 (patch) | |
| tree | a023c5f5af65cfe8f20354c388c683c57437e5d2 /internal/askcli/taskexec.go | |
| parent | 56e9f980e52a53197ace71acdb277ba0e0368916 (diff) | |
docs: document askcli exports
Diffstat (limited to 'internal/askcli/taskexec.go')
| -rw-r--r-- | internal/askcli/taskexec.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/internal/askcli/taskexec.go b/internal/askcli/taskexec.go index 59d9b55..b188230 100644 --- a/internal/askcli/taskexec.go +++ b/internal/askcli/taskexec.go @@ -16,6 +16,7 @@ type repoTopLevelDetector func(context.Context) (string, error) type commandRunner func(context.Context, string, []string, io.Reader, io.Writer, io.Writer) error +// Executor encapsulates how ask communicates with the Taskwarrior binary. type Executor struct { commandName string findBinary binaryFinder @@ -23,6 +24,7 @@ type Executor struct { runCommand commandRunner } +// NewExecutor constructs an Executor that invokes Taskwarrior via the given command name. func NewExecutor(commandName string) Executor { return Executor{ commandName: strings.TrimSpace(commandName), @@ -43,6 +45,7 @@ func (e Executor) taskArgs(repoRoot string, args []string) ([]string, error) { return append([]string{"rc.verbose=nothing", "rc.confirmation=off", "project:" + projectName, "+agent"}, args...), nil } +// Run delegates CLI arguments to Taskwarrior, enforcing agent defaults and error handling. func (e Executor) Run(ctx context.Context, args []string, stdin io.Reader, stdout, stderr io.Writer) (int, error) { executor := normalizeExecutor(e) taskPath, err := executor.findBinary() |
