IF Commons GitHub

commands/program

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0001-ergonex FR-001

The program ergonex as Headless' tree (commons 0001-ergonex FR-001, FR-003; commons headless 0003-headless-output FR-001): its commands and branches, each declared with the facts of its action, its options, operands and examples, and the data Headless configures itself with (the name and version, the prefix of the variables, the codes it explains, the secrets it redacts, the command it runs where none is given). ergonexProgram(host) is the one place the tree is made; the command line runs it (ergonex.ts), and anything that describes a program (a documentation lens, a tool server) reads it.

Source: commons/ergonex/src/commands/program.ts

1 of 5 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

ergonexProgramfunction
function ergonexProgram(host: ProgramHost): Program

ergonex as a Headless program, for the host it runs on.

Imported by 4 tests of the run (4 passed, 0 failed): the library's results

modulesOffunctionno test imports it
function modulesOf(nodes: readonly Node[]): readonly ErgonexModule[]

The words of the program's own tree, for the modules a command lists and the snippet of a shell: each top-level word with its summary and the words below it.

TREEconstno test imports it
const TREE: readonly Entry[]

The tree of the program, in the order the help lists it.

Entrytypeno test imports it
type Entry =
  | { readonly kind: "command"; readonly make: Make }
  | { readonly kind: "branch"; readonly name: string; readonly summary: string; readonly children: readonly Make[] };

An entry of the program's tree: a command, or a branch of commands, each made for a host. Tagged, so that a switch over it is exhaustive.

ProgramHosttypeno test imports it
type ProgramHost = Omit<Host, "builtins">;

What the host needs of the tree before it is made: the modules its commands list are the words of the tree itself.

Titles, headings, exports, tables, columns and requirements. Esc closes.