Documentation
¶
Overview ¶
Package command is the yupsh command catalogue: the registry mapping each command keyword to how its flags are parsed and how its pipeline segment is built from the gloo-foo/cmd-* modules.
Each registry entry is a Builder: a flag table (a flags.Set), a BuildFunc that turns parsed positionals and options into a Segment, an optional raw passthrough mode for commands whose arguments are literal text, and a one-line summary for help output. A Segment is the built form of one pipeline stage — a source, a transform command, and at most one input source (files or literal inputs). The package knows how to construct commands; it does not run them (that is internal/pipeline) nor orchestrate a line (that is the line domain).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BuildFunc ¶
BuildFunc constructs a Segment from a command's positional arguments and the already-parsed flag options. The filesystem is injected for the commands (ls, find) that build against it.
type Builder ¶
Builder is a registry entry: how to parse a command's flags, how to build its segment, and a one-line summary for help output. When Raw is set, flag parsing is skipped and every token is passed through as a positional — used by commands whose arguments are literal text (echo, yes, emit) or belong to an external program (git, exec).
type Segment ¶
type Segment struct {
Source gloo.Source[[]byte]
Command gloo.Command[[]byte, []byte]
Files []gloo.File
Inputs [][]byte
}
Segment is the built form of one pipeline stage. A source segment sets Source and no command. A filter segment sets Command and, optionally on the first stage, an input source: Files are opened from the filesystem, while Inputs are used verbatim as input lines (for path processors like basename whose arguments are data, not filenames). At most one of Files or Inputs is set.