Documentation
¶
Overview ¶
Package cli is the meaninggraph command line: the commands, their output and their exit codes. Everything that touches the outside world (the file system, the output streams, the terminal, the update server) comes in through Env, so the whole command line runs in a test without a process, a network or a real terminal.
Index ¶
Constants ¶
View Source
const ( // ExitClean means the command succeeded: a check found no error. ExitClean = 0 // ExitFindings means a check found at least one finding of error severity. ExitFindings = 1 // ExitUsage means the command was used wrongly or a file could not be // read: nothing was checked. ExitUsage = 2 )
Exit codes of the command line.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Env ¶
type Env struct {
Stdin io.Reader
Stdout, Stderr io.Writer
// FS reads the files that are checked.
FS meaning.FS
// Abs makes a path absolute, so that one directory written two ways is
// read once.
Abs func(string) (string, error)
// Interactive says whether the process has a terminal to ask a question
// on; nil means the update library's own terminal check.
Interactive func() bool
// SelfUpdate describes where updates come from; tests point it at a fake
// release server.
SelfUpdate func() selfupdate.Config
}
Env is everything the command line needs from the outside.
Click to show internal directories.
Click to hide internal directories.