Documentation
¶
Overview ¶
config.go — the `taskmgr config` command tree: read and write the scalar keys of a configuration file. The `use:` list of hook packages is a list, not a scalar, and belongs to `taskmgr package` (pkg.go).
Two files are addressable. Without --global the target is the resolved store's config.yaml (TASK-STORAGE-SPEC §4.2); with it, the per-user config.yaml (CONFIG-SPEC §2), which resolves no store and therefore works anywhere.
Every write goes through the SDK (Store.UpdateConfig / tasks.UpdateGlobalConfig), which re-reads the file under its lock and applies the edit there, so two concurrent invocations cannot discard each other's work.
pkg.go — `taskmgr package` and `taskmgr hook list`: the surface for hook packages (CLI-SPEC §2.3).
Three commands, one of which writes. A package itself is authored by hand — it is a directory with one owner, so there is nothing for taskmgr to mediate. What needs a command is the `use:` list, which lives in a shared, lock-protected config file, and the merged chain, which neither config file shows on its own.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( Version = "dev" Commit = "none" Date = "unknown" )
Build info, overridable via -ldflags.
Functions ¶
func Execute ¶
func Execute()
Execute runs taskmgr as a process: one invocation, then exit.
It is a wrapper over Run so that owning os.Exit and owning the command logic are two different things. Everything worth testing is in Run.
func Run ¶ added in v0.9.0
Run executes one taskmgr invocation with the given arguments, writing everything the command emits to stdoutW and stderrW — log records included — and returns the exit code the process would use: 0 on success, 1 on any failure. A nil args is the empty argument list, not the process's own.
This is the entry point tests use. Asserting on output previously meant `go build` plus a fork, which is why 120 of the CLI's 121 tests sat behind the integration tag and its pure helpers had no tests at all.
Run is NOT safe for concurrent use within one process: the command tree and the output writers are package-level state, reset per invocation rather than rebuilt. Sequential calls are independent — every flag returns to its default and the writers are restored — but two Runs at once would interleave. Do not call t.Parallel in a test that uses it.
Types ¶
This section is empty.