Subjecttypeno test imports ittype Subject = { readonly packages: readonly string[]; readonly version?: string | undefined };What a command is made for: the packages (the version, where there is one, is the first's) and nothing else.
The command of an operation as an argument vector: the words of the ontology's template with the names put where they go (never through a shell), the exact version written as the manager writes it, the environment the manager needs as the env program, and the program that raises the rights put first only where the manager needs them. A name or a version that could be taken for an option is refused.
import { commandArgv } from "./argv.ts";
// commandArgv(spec, { packages: ["jq"], version: "1.7.1" }, { kind: "joined", joiner: "=" }, { elevate: [] })Subjecttypeno test imports ittype Subject = { readonly packages: readonly string[]; readonly version?: string | undefined };What a command is made for: the packages (the version, where there is one, is the first's) and nothing else.
Shapetypeno test imports ittype Shape = { readonly elevate?: readonly string[]; readonly interactive?: boolean };What changes the command made: the program that raises the rights (none by default) and whether the form that asks a person nothing is used (it is, by default).
Argvtypeno test imports ittype Argv = { readonly argv: readonly string[]; readonly admin: boolean; readonly verified: boolean };A command ready to run.
commandArgvfunctionfunction commandArgv(spec: CommandSpec, subject: Subject, versioning: Versioning, shape?: Shape): Result<Argv, string>The argument vector of a command for a subject, or why it cannot be made.
versionInfunctionfunction versionIn(text: string): string | undefinedThe first version in the text a manager prints, without an epoch (1:2.43.0-1 is 2.43.0-1) and without a trailing dot, or nothing.
sameVersionfunctionfunction sameVersion(observed: string, wanted: string): booleanWhether an installed version is the one asked for: the same, or the one asked for followed by a packager's revision (2.43.0 is 2.43.0-1ubuntu7).