pipe

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(w io.Writer, args []string, opts Options, registry *CommandRegistry) error

Run executes a pipeline of commands

func RunWithInput

func RunWithInput(w io.Writer, input string, args []string, opts Options, registry *CommandRegistry) error

RunWithInput executes a pipeline with initial input

Types

type CommandRegistry

type CommandRegistry struct {
	RootCmd *cobra.Command
}

CommandRegistry holds references to available commands

func NewRegistry

func NewRegistry(rootCmd *cobra.Command) *CommandRegistry

NewRegistry creates a new command registry

type CommandResult

type CommandResult struct {
	Command string `json:"command"`
	Output  string `json:"output,omitempty"`
	Error   string `json:"error,omitempty"`
}

CommandResult represents a single command's execution

type Options

type Options struct {
	JSON      bool   // --json: output pipeline result as JSON
	Separator string // --sep: command separator (default "|")
	Verbose   bool   // --verbose: show intermediate steps
	VarName   string // --var: variable name for output substitution (default "OUT")
}

Options configure the pipe command behavior

type Result

type Result struct {
	Commands []CommandResult `json:"commands"`
	Output   string          `json:"output"`
	Success  bool            `json:"success"`
	Error    string          `json:"error,omitempty"`
}

Result represents the pipeline execution result

Jump to

Keyboard shortcuts

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