Documentation
¶
Overview ¶
Package cmdgrouper provides types for grouping together commands.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Grouper ¶
type Grouper interface {
// Process considers the command for inclusion in the group.
Process(context.Context, api.CmdID, api.Cmd, *api.GlobalState)
// Build returns the groups built and resets the state of the grouper.
Build(end api.CmdID) []Group
}
Grouper is the interface implemented by types that build groups.
func Marker ¶
func Marker() Grouper
Marker returns a grouper that groups based on user marker commands.
type Rule ¶ added in v0.6.1
type Rule struct {
// Pred returns true if the rule passes.
Pred func(cmd, prev api.Cmd) bool
// Repeats is true if the rule should repeat until it no longer passes.
// The rule has to pass at least once for the sequence to complete.
Repeats bool
// Optional is true if the rule can be skipped and still have the sequence
// complete.
Optional bool
}
Rule is a single rule in a sequence grouper.
Click to show internal directories.
Click to hide internal directories.