clirun

package
v1.56.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package clirun executes external commands with structured error reporting.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check

func Check(name string, args ...string) error

Check runs a command and returns a typed Error on failure.

func MissingTools

func MissingTools(tools []string) []string

MissingTools returns the subset of the supplied names not on PATH.

func ShellQuote

func ShellQuote(s string) string

ShellQuote wraps a string in POSIX-safe single quotes.

Types

type Error

type Error struct {
	Cmd    string
	Code   int
	Stderr string
	Err    error
}

Error captures a non-zero exit status from an external command.

func (*Error) Error

func (e *Error) Error() string

func (*Error) Unwrap

func (e *Error) Unwrap() error

type Result

type Result struct {
	Stdout   string
	Stderr   string
	ExitCode int
	Err      error
}

Result is the captured output of a command run.

func Run

func Run(name string, args ...string) Result

Run executes a command and captures stdout/stderr.

Jump to

Keyboard shortcuts

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