Documentation
¶
Index ¶
Constants ¶
const ( ExitSuccess = 0 ExitGhError = 1 ExitNoRepo = 2 ExitNoPRs = 3 ExitUsage = 64 )
const DefaultFormat = render.FormatText
DefaultFormat is the human-readable terminal output selected when neither --format nor GH_PRS_FORMAT is provided.
const USAGE = `` /* 1770-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
func Execute ¶
Execute parses flags, runs the app, returns the exit code. Never panics; maps all errors to exit codes via MapError. Call site: main.go -> os.Exit(cli.Execute(os.Args[1:], os.Environ()))
func MapError ¶
MapError maps any error to an exit code. Pass err=nil with hasPRs=false for the empty-results case (ExitNoPRs); hasPRs=true yields ExitSuccess.
func PrintRESTEquivalent ¶
PrintRESTEquivalent writes the 9-line "DEBUG REST equivalent" block to stderr when --debug is set. Signature mirrors the TS debug-output.ts.
func ShouldColor ¶
ShouldColor decides whether ANSI color escapes are emitted. Rules (in order):
- NO_COLOR truthy => false
- FORCE_COLOR set => parse FORCE_COLOR as truthy-flag
- fall back to stdoutIsTTY
func ShouldOSC8 ¶
ShouldOSC8 returns stdoutIsTTY. NO_COLOR does not gate OSC8.
Types ¶
type Flags ¶
type Flags struct {
// Format is the canonical name of the chosen output format. Never empty:
// composeFlags resolves missing input to DefaultFormat. Validity is
// checked separately via render.Lookup in Execute.
Format string
Debug bool
Help bool
NoCache bool
CacheTTL string
Stats bool
// Authors holds the --author logins (repeatable flag). An empty slice
// means the caller should apply the "@me" default. composeFlags never
// injects "@me" here — that policy lives in runOnce where filter.Set
// is constructed.
Authors []string
}
type Spinner ¶
type Spinner struct {
// contains filtered or unexported fields
}
Spinner writes a braille frame to stderr every spinnerInterval when started against a TTY. Stop is idempotent and always clears the current line.
func NewSpinner ¶
NewSpinner constructs a spinner. enabled is the caller's intent (false for --json); stderrIsTTY short-circuits to a no-op when false.