Documentation
¶
Overview ¶
Package cli is the modelspec command line: lint, export, rewrite, version and self-update. Everything the commands touch (filesystem, output streams, build information, the update source) comes in through Env, so tests run them in memory.
Index ¶
Constants ¶
View Source
const ( ExitOK = 0 ExitFindings = 1 ExitUsage = 2 ExitUpdateAvailable = 10 )
Exit codes. Lint and export use 0, 1 and 2; 10 is reserved for `self-update --check` finding a newer release.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Env ¶
type Env struct {
Stdout, Stderr io.Writer
FS modelspec.FS
Build buildinfo.Info
Update selfupdate.Config
// Interactive reports whether stdin is a terminal; nil means the
// self-update library's own check.
Interactive func() bool
// MaxTwinBytes is the largest JSON twin export writes; zero means
// modelspec.MaxInputBytes, the largest file lint reads. A seam for tests.
MaxTwinBytes int
}
Env is everything a command touches outside its own arguments.
Click to show internal directories.
Click to hide internal directories.