Documentation
¶
Overview ¶
Package cli wires the command-line surface: Runefile resolution, the parse → analyze → run pipeline, task dispatch, and exit-code mapping.
Index ¶
Constants ¶
const ( ExitSuccess = 0 // all requested tasks succeeded ExitTaskFail = 1 // a task body failed ExitUsage = 2 // usage error / no Runefile / unknown task / bad args ExitValidation = 3 // static parse/analyze error — nothing executed ExitInterrupt = 130 // interrupted (SIGINT) )
Exit codes (contracts/cli.md, FR-021).
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Interrupted ¶
type Interrupted struct{ Err error }
Interrupted marks a SIGINT (exit 130).
func (*Interrupted) Error ¶
func (e *Interrupted) Error() string
func (*Interrupted) Unwrap ¶
func (e *Interrupted) Unwrap() error
type Options ¶
type Options struct {
File string // -f/--file
List bool // --list
DryRun bool // --dry-run
Summary bool // --summary
Dump bool // --dump
DumpFormat string // --format (with --dump)
Set []string
Watch bool
Choose bool
Yes bool
Quiet bool
Fmt bool
ClearCache bool
Color bool // resolved: emit ANSI color
Version string
Cwd string
Ctx context.Context // cancelled on SIGINT (nil => Background)
Stdin io.Reader
Stdout io.Writer
Stderr io.Writer
// Commands are the reserved subcommand names (and aliases). They are used
// only to enrich the "unknown task" error with a did-you-mean suggestion.
Commands []string
}
Options carries the resolved global CLI flags and I/O streams for one invocation. main.go populates it from cobra and passes it to Run.
type TaskCandidate ¶
TaskCandidate is a completable task: its name plus the first line of its doc comment, used as the shell-completion description.
func TaskCandidates ¶
func TaskCandidates(opts Options) []TaskCandidate
TaskCandidates returns the non-private, OS-matching tasks of the resolved Runefile, each with its first doc line, for dynamic shell completion. It is deliberately tolerant: any failure (no Runefile, read error, parse/compose error) yields nil so completion degrades gracefully and never disrupts the shell session. The analyzer is intentionally skipped — task names should still complete when the Runefile has semantic (not syntactic) errors.
type TaskFailure ¶
TaskFailure marks a task body failure (exit 1). Silent suppresses the trailing error banner (the [no-exit-message] attribute) without changing the exit code.
func (*TaskFailure) Error ¶
func (e *TaskFailure) Error() string
func (*TaskFailure) Unwrap ¶
func (e *TaskFailure) Unwrap() error
type UsageError ¶
type UsageError struct{ Err error }
UsageError marks an error as a usage/discovery problem (exit 2).
func (*UsageError) Error ¶
func (e *UsageError) Error() string
func (*UsageError) Unwrap ¶
func (e *UsageError) Unwrap() error
type ValidationError ¶
type ValidationError struct{ Err error }
ValidationError marks a static parse/analyze failure (exit 3). The diagnostics have already been rendered to stderr by the caller; this type only carries the exit code intent.
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
func (*ValidationError) Unwrap ¶
func (e *ValidationError) Unwrap() error