shellargs

package
v4.24.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArgsAfterBinary

func ArgsAfterBinary(example string) ([]string, error)

ArgsAfterBinary returns every token after the leading binary name.

func Split

func Split(s string) ([]string, error)

Split tokenizes the simple command examples the Printing Press emits in README/SKILL narrative. It preserves double-quoted and single-quoted tokens and backslash escapes (POSIX semantics: backslashes are literal inside single quotes), but intentionally does not perform shell expansion.

Types

type ChainSegment added in v4.13.0

type ChainSegment struct {
	// Text is the segment as it appeared in the source, with surrounding
	// whitespace trimmed.
	Text string
	// AfterPipe is true when this segment sat to the right of a top-level
	// pipe operator. Callers that execute commands should usually skip these
	// because their input would normally arrive over a shell pipe.
	AfterPipe bool
}

ChainSegment is one runnable or pipe-skipped piece of a shell-style command.

func SplitChain added in v4.13.0

func SplitChain(command string) ([]ChainSegment, error)

SplitChain returns segments separated by top-level &&, ||, ;, or | operators. Quoted text is preserved. Segments after a top-level | carry AfterPipe=true.

Jump to

Keyboard shortcuts

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