summaryrefslogtreecommitdiff
path: root/cmd/hexai/task_command.go
blob: a942f71b75fb7aeac42f4aa7d29d073c1b1eabf5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package main

import (
	"context"
	"io"

	"codeberg.org/snonux/hexai/internal/taskproxy"
)

func runTaskSubcommandIfRequested(args []string, stdin io.Reader, stdout, stderr io.Writer) (bool, int, error) {
	if len(args) == 0 || args[0] != "task" {
		return false, 0, nil
	}
	code, err := taskproxy.NewRunner("hexai task").Run(context.Background(), args[1:], stdin, stdout, stderr)
	return true, code, err
}