IF Commons GitHub

sql/cli/main

Written to: 4 requirements: 4 proved, 0 partly, 0 failing, 0 with no test recorded. 0046-arcactl FR-001, 0046-arcactl FR-002, 0046-arcactl FR-003, 0046-arcactl FR-009

The command line of arcactl (commons data 0046-arcactl): doctor first. It is a function of its arguments and environment that returns the exit code and what to print, so that a test runs it on any database; the file arcactl.ts only gives it the real process. Exit codes: 0 every check passed, 1 a check warned, failed or could not be made, 2 the command was wrong or the database could not be reached.

Source: commons/data/sql/cli/main.ts

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

Iointerface
interface Io

What the command line is given besides its arguments.

MemberTypeWhat it is
envReadonly<Record<string, string | undefined>>
cwdstring
tty?booleanWhether input and output are a terminal, which decides between the workstation and the server (0047-arcactl-init FR-004).
read?((path: string) => string)Reads a file, for a secret given as <NAME>_FILE.
platform?PlatformThe platform whose files init and the workstation checks use; this machine's by default.
prompt?PrompterWhat a person at a terminal can be asked (init).
stdin?(() => Promise<string>)Reads standard input to its end (init --password-stdin).
psqlVersion?(() => string | undefined)How psql --version is asked (a test's own).
connect?((o: ConnectOptions) => Promise<Connection>)Makes the connection; the real one by default, and a test's own where a test gives one.

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

mainfunction
function main(argv: readonly string[], io: Io): Promise<Outcome>

Runs arcactl.

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

USAGEconst
const USAGE: string

The text that arcactl --help prints: its commands, options and exit statuses.

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

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