Documentation
¶
Overview ¶
Package cli is the sitrep command line: it parses arguments, runs the commands and prints their answers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Env ¶
type Env struct {
Home string
Getenv func(string) string
Stdin io.Reader
Stdout io.Writer
Stderr io.Writer
Clock clock.Clock
Runner runner.Runner
TTY func() (io.ReadCloser, error) // the controlling terminal, for questions; nil or an error means there is none
Executable func() (string, error) // the path of this program
Spawn func(args ...string) error // starts this program again, detached; the hook uses it for the summarizer
Alive func(pid int) bool // whether a process exists; nil means ask the system
TermSize func() (rows, cols int, ok bool) // the size of the terminal on standard output; nil or !ok means there is none
Hostname func() (string, error) // the name of this machine, for the history log; nil means "host"
// contains filtered or unexported fields
}
Env is everything a command touches outside its arguments, so tests can replace it.
Click to show internal directories.
Click to hide internal directories.