Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArgsAfterBinary ¶
ArgsAfterBinary returns every token after the leading binary name.
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.
Click to show internal directories.
Click to hide internal directories.