Documentation
¶
Overview ¶
Package cli maps loupe's commands onto cobra and turns domain results and refusals into the output contract.
Index ¶
Constants ¶
const DefaultReleases = "https://github.com/secondshift-labs/loupe/releases"
DefaultReleases is where loupe's releases download from.
const WarnUpdateAvailable = "update-available"
WarnUpdateAvailable is the warning code a capture result carries when a newer loupe release exists.
const WarnWithdrawReasonMissing = "withdraw-reason-missing"
WarnWithdrawReasonMissing is the warning code an edit result carries when an agent withdrew a finding without saying why.
Variables ¶
This section is empty.
Functions ¶
func ConflictsWithFrom ¶
ConflictsWithFrom refuses when --from is combined with any flag that sets the same content.
func DecodeInput ¶
DecodeInput reads JSON from the file at from, or from stdin when from is "-".
Types ¶
type Deps ¶
type Deps struct {
// Context ends a command that waits; nil means Background.
Context context.Context
Stdin io.Reader
Stdout io.Writer
Stderr io.Writer
Getenv func(string) string
Now func() time.Time
WorkDir string
// GitHub is a func so commands that never talk to GitHub never build a client or read credentials.
GitHub func() (github.Client, error)
IsTerminal func() bool
// StderrIsTerminal is consulted only under --json, where human-only commands draw on stderr.
StderrIsTerminal func() bool
// TermWidth is the terminal width human output wraps to; nil means the default of 80 columns.
TermWidth func() int
// TTYWidth is the agent's own terminal width, which picks a handoff's split direction; nil means unreadable.
TTYWidth func() (int, bool)
// GOOS is the operating system a handoff detects hosts on; empty is not macOS, so no test meets a macOS-only host.
GOOS string
// OpenURL opens a published review in the browser; nil means review offers no way to.
OpenURL func(string) error
// LockBusy, when set, runs each time capture finds its lock held; tests use it to know a second capture is waiting.
LockBusy func()
// Version, when set, replaces the version stamped into the build, so that a test can act as a release.
Version string
// Releases, when set, replaces DefaultReleases, so that update and uninstall download from a test's server.
Releases string
// Executable finds the running binary for update and uninstall; nil means os.Executable.
Executable func() (string, error)
// Screen, when set, is a test's stand-in for the terminal review and publish draw on; see tui.Screen.
Screen *tui.Screen
// contains filtered or unexported fields
}