cmd

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2026 License: MIT Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExitValidation   = 2 // bad flag, missing/invalid arg, unknown key, unparseable value
	ExitNotFound     = 3 // resource (URL, crawl id, selector match) absent
	ExitUpstream     = 4 // network/fetch/backend failure outside our control
	ExitPrecondition = 5 // missing API key, already-exists, locked
	ExitCancelled    = 6 // SIGINT/SIGTERM observed
)

Exit codes follow the table in references/cli-conventions.md and are surfaced to scripts/agents via os.Exit in main.go.

Variables

This section is empty.

Functions

func Execute

func Execute() error

func ExecuteContext

func ExecuteContext(ctx context.Context) error

ExecuteContext runs the root command with a caller-supplied context. main.go passes a context that cancels on SIGINT/SIGTERM so foreground commands (notably crawl) can shut down gracefully.

Types

type ExitError

type ExitError struct {
	Code int
	Err  error
}

ExitError carries a numeric exit code alongside the wrapped error. main.go inspects this via errors.As to translate RunE failures into the process exit code. Unwrapped errors continue to exit 1.

func (*ExitError) Error

func (e *ExitError) Error() string

func (*ExitError) Unwrap

func (e *ExitError) Unwrap() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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