Documentation
¶
Overview ¶
Package cli dispatches soapbox subcommands.
Dispatch uses the standard library flag package. Every command writes to injected writers and returns an error, so the process exit code is decided in exactly one place and no code path calls os.Exit or panics on bad input.
Index ¶
Constants ¶
View Source
const ( // ExitOK reports success. ExitOK = 0 // ExitFailure reports an unexpected runtime failure. ExitFailure = 1 // ExitUsage reports a malformed command line. ExitUsage = 2 // ExitCheck reports that the command ran and found policy violations. ExitCheck = 3 // ExitCanceled reports that the context ended before the command did. ExitCanceled = 4 )
Process exit codes. They are part of the workflow contract, so they are stable and distinct.
View Source
const Version = buildinfo.Version
Version is the engine version reported by the version command.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Env ¶
type Env struct {
// Stdout receives command output. A nil writer discards it.
Stdout io.Writer
// Stderr receives diagnostics. A nil writer discards it.
Stderr io.Writer
// Dir is the working directory relative paths resolve against.
Dir string
}
Env carries the injectable process environment of one command run.
Click to show internal directories.
Click to hide internal directories.