run(program, argv, io) MUST give { code, out, err } and touch no process global: the environment, what each stream is, the clock, a line of input, the files of the state, the signals, a timer and an observer MUST be given in io, so that a run is deterministic; it MUST answer --version, help, explain, completions and man itself, say did you mean for an unknown word as the terminal does (and exit 2), run the program's default command where no word is given, and otherwise run the command it resolves. Taken from: arcactl (run(argv, io)), erga 274-agora FR-006 to FR-009 (declared verbs, did-you-mean, default verb).
Enforced (check): .github: cd commons/headless && bun run verify — suite/cli-help.test.ts: help is shown by --help, -h and `help`, at every level, and the same text each way; suite/cli-process.test.ts: the host binds the world of the process and nothing else does: the environment, the streams' kind, the clock, the signals, the timer and a line of input; suite/cli-run.test.ts: golden: an action with nothing to say ends with the verdict alone, on the error stream, with status 0; suite/cli-run.test.ts: --json is one document and nothing for a person; --sarif the same as SARIF; neither with colour; suite/cli-run.test.ts: the surface answers --version, help, explain, completions and man itself, and runs the default command where no word is given; suite/cli-run.test.ts: a run touches no process global: the same world gives the same result, whatever the process's own environment is; suite/cli-run.test.ts: a destructive action asks the person where there is one, runs with --yes, and is refused with no terminal and no --yes; suite/cli-run.test.ts: a nested run writes its summary to its parent's file and draws nothing; the parent reads it back; suite/cli-run.test.ts: a secret the program holds never reaches the output, the error, the log or the JSON, however a command tells it
Proved by: headless/suite/cli-help.test.ts, headless/suite/cli-process.test.ts, headless/suite/cli-run.test.ts
Written in: headless/src/surfaces/cli/host.ts, headless/src/surfaces/cli/io.ts, headless/src/surfaces/cli/run.ts
Tests: passed: suite/cli-help.test.ts help is shown by --help, -h and `help`, at every level, and the same text each way; passed: suite/cli-process.test.ts the host binds the world of the process and nothing else does: the environment, the stream; passed: suite/cli-run.test.ts golden: an action with nothing to say ends with the verdict alone, on the error stream, wi; passed: suite/cli-run.test.ts --json is one document and nothing for a person; --sarif the same as SARIF; neither with c; passed: suite/cli-run.test.ts a secret the program holds never reaches the output, the error, the log or the JSON, howev and 4 more
Cited by: Headless, surfaces/cli/host, surfaces/cli/io, surfaces/cli/run