forloop

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 RunEach

func RunEach(w io.Writer, items []string, command string, opts Options) error

RunEach executes a command for each item in a list Usage: for each ITEM1 ITEM2 ... -- COMMAND

func RunGlob

func RunGlob(w io.Writer, pattern, command string, opts Options) error

RunGlob executes a command for each file matching a glob pattern Usage: for glob PATTERN -- COMMAND

func RunLines

func RunLines(w io.Writer, r io.Reader, command string, opts Options) error

RunLines executes a command for each line from stdin or file Usage: for lines [FILE] -- COMMAND

func RunRange

func RunRange(w io.Writer, start, end, step int, command string, opts Options) error

RunRange executes a command for each number in a range Usage: for range START END [STEP] -- COMMAND

func RunSplit

func RunSplit(w io.Writer, input, delimiter, command string, opts Options) error

RunSplit executes a command for each token split by delimiter Usage: for split DELIM INPUT -- COMMAND

Types

type Options

type Options struct {
	Delimiter string // delimiter for splitting input
	Variable  string // variable name to use (default: item)
	DryRun    bool   // print commands without executing
	Parallel  int    // number of parallel executions (0 = sequential)
}

Options configures the for command behavior

Jump to

Keyboard shortcuts

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