The kit is shared by programs with other names, other targets and other rules for their exit codes. So the kit decides nothing that a program must decide. What depends on a program is a parameter or a hook.
What the kit never does#
- It reads no environment. Whether to draw in colour,
NO_COLORandTERMincluded, is the program’s to decide.cliprogressis told what the program read. - It sets nothing process-wide. It installs no signal handler and sets no global, such as the default logger.
- It ends no process. An error goes back to the program, which picks the exit status.
The linter refuses the calls that read or set the environment, handle signals or end the process, outside the tests (decision 21).
The hooks#
| What the program decides | Where it tells the kit |
|---|---|
| Its name, in a line that says something panicked | BusOptions.Program, cliprogress.Options.Program |
| The noun for its targets: “1 host”, “480 hosts” | PlainOptions.Noun, MapOptions.Noun, cliprogress.Options.Noun |
| The class of an error, for its exit codes | progress.BusOptions.Classify, MapOptions.Classify |
| The exit status of an error | cobratree.Coded where the cause is known, cobratree.Status in main |
| The usage errors, for their exit status | cobratree.Usage, cobratree.IsUsage |
| The flag and variable that pick a display and a log | cliprogress.Options.Mode and .Log, a cliprogress.Setting each |
| Whether standard error is a terminal, its size, the locale | cliprogress.Options.OnTerminal, .Size, .ASCII |
| The theme, and the colours | cliprogress.ThemeFor |
| The interrupt | the end of the context given to cliprogress.Start |
| The trace another program handed on | progress.ParseTraceContext of what the program read from TRACEPARENT |
| Where its files live, and how long it waits for a lock | the paths it passes fsutil, the wait it passes fsutil.Lock |
The checks of doctor, and the exit status of a failed one | doctor.Write and doctor.Worst |
The architecture has the whole table, for every package.