Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CmdOption ¶
type CmdOption func(*Command)
CmdOption defines a function that applies configuration to a Command
func WithArgs ¶
WithArgs returns a CmdOption that appends positional args for formatting the command template
func WithParser ¶
WithParser returns a CmdOption that assigns a parser to handle the raw command result
type Command ¶
type Command struct {
Template string // format string for the command, used with fmt.Sprintf
Args []any // values to plug into the template
Parser parser.Parser // optional parser to process command output
}
Command represents a shell command with a template, positional arguments, and an optional parser
Click to show internal directories.
Click to hide internal directories.