commandmatch

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BranchResult

type BranchResult struct {
	Command string `json:"command"`
	Success bool   `json:"success"`
	Output  string `json:"output"`
}

type BranchingEngine

type BranchingEngine struct {
	// contains filtered or unexported fields
}

func NewBranchingEngine

func NewBranchingEngine() *BranchingEngine

func (*BranchingEngine) AddFailure

func (e *BranchingEngine) AddFailure(command, handler string)

func (*BranchingEngine) AddSuccess

func (e *BranchingEngine) AddSuccess(command, handler string)

func (*BranchingEngine) Execute

func (e *BranchingEngine) Execute(result *BranchResult) string

type CommandMatcher

type CommandMatcher struct {
	// contains filtered or unexported fields
}

func NewCommandMatcher

func NewCommandMatcher() *CommandMatcher

func (*CommandMatcher) ExtractBasename

func (m *CommandMatcher) ExtractBasename(command string) string

func (*CommandMatcher) Match

func (m *CommandMatcher) Match(command string) *CommandRule

func (*CommandMatcher) StripFlags

func (m *CommandMatcher) StripFlags(command string) string

type CommandRule

type CommandRule struct {
	Name     string `json:"name"`
	Basename string `json:"basename"`
	Pattern  string `json:"pattern"`
	// contains filtered or unexported fields
}

type MatchOutput

type MatchOutput struct {
	FullOutput string `json:"full_output"`
	Substring  string `json:"substring"`
	MatchCount int    `json:"match_count"`
	Matched    bool   `json:"matched"`
}

func MatchWholeOutput

func MatchWholeOutput(output, substring string) *MatchOutput

Jump to

Keyboard shortcuts

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