cli

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BootstrapOptions

func BootstrapOptions(opts *cliopts.Options) bootstrap.Options

BootstrapOptions mirrors the parsed CLI options into bootstrap.Options. bootstrap never imports this package, so cli is the one place that translates between them.

func HandleBootstrapErr

func HandleBootstrapErr(command string, err error) int

HandleBootstrapErr reports a composition-root wiring failure and returns the process exit code. A hook invocation must never block the caller's turn over a governance-loading hiccup, so it degrades to a no-op (exit 0) instead of failing like every other command.

func Run

func Run(inj remy.Injector, opts *cliopts.Options) error

Run dispatches opts.Command to its handler. It is the ONE switchboard cmd/pulsarules_cli/main.go calls after the injector is wired.

Types

type ExitError

type ExitError struct {
	Code int
}

ExitError signals that main must exit the process with Code instead of the generic exit-1 path taken for every other returned error. Commands that used to call os.Exit directly (runGovernance, runCommitLint on an error-severity finding) return an *ExitError instead, keeping os.Exit the sole province of main.

func (*ExitError) Error

func (e *ExitError) Error() string

Error implements the error interface. The command has already printed its findings to stderr by the time it returns an ExitError, so the message is only a fallback for a caller that logs the error value directly.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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