Documentation
¶
Overview ¶
Package cli defines the command surface. It stays deliberately thin: parse flags, resolve config, call a package, hand the result to output. Business logic that appears here belongs somewhere else.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Env ¶
type Env struct {
Streams *output.Streams
Stdin io.Reader
// Getenv defaults to os.Getenv.
Getenv func(string) string
// Now defaults to time.Now. Every date range derives from it.
Now func() time.Time
// Interactive reports whether a human can answer a prompt.
Interactive func() bool
// OpenBrowser defaults to launching the system browser.
OpenBrowser func(url string) error
// APIEndpoint overrides the Search Console base URL. Tests only.
APIEndpoint string
// Retry is passed through to the API client.
Retry api.RetryPolicy
// InspectRate paces batch inspection, in requests per second. Zero selects
// the default; tests raise it so pacing does not slow the suite down.
InspectRate int
Version string
Commit string
// contains filtered or unexported fields
}
Env is everything a command needs that would otherwise be global state. Injecting it is what lets the whole command surface be tested in-process, with no environment variables set and no browser opened.
func (*Env) ResultFormat ¶
ResultFormat is the format the caller asked for, defaulting to json when the run failed before --format could be parsed.
Click to show internal directories.
Click to hide internal directories.