root

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 11, 2026 License: MIT Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCompletionHandled = errors.New("completion request handled")

ErrCompletionHandled is returned by Execute when a shell-completion preflight request was fully serviced. main translates it into a zero-exit termination; no command runs. Keeping this as a returned sentinel — rather than an os.Exit deep in construction — leaves main the sole owner of process exit.

Functions

func Execute

func Execute(ctx context.Context) error

Execute builds the runtime and root command for a process invocation, services any shell-completion preflight, applies the optional whole-invocation timeout, and runs the command tree against ctx.

ctx is the root context main owns (signal-aware via signal.NotifyContext). Execute never calls os.Exit: a completion preflight that was fully handled is reported back to main as ErrCompletionHandled.

func ExitCode

func ExitCode(err error) int

ExitCode maps err to its process exit code. It delegates to the central cli.ExitCode mapper so every error type (credential, Jira API, rate-limit, validation, command-local) carries the correct stable code.

func New

func New(rt *runtime.Runtime) *cobra.Command

New builds a fully assembled root command for the given runtime — the importable entry point used by both cmd/jira (to run) and cmd/gen-docs (to generate reference docs). The bare root plus every command family and the shell completion command. Each call yields an independent command tree with its own flag set and IO wiring — no process-global command state.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL