augment

package
v0.0.0-...-6018c67 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildAndRun

func BuildAndRun(commands []CommandAugmentationInput, augmenter []FlagAugmentationInput, args []string)

func BuildContext

func BuildContext(augmenter []FlagAugmentationInput, args []string) map[int]AugmentationResult

func MakeCommand

func MakeCommand(args []string, context map[int]AugmentationResult) []string

func OneOffCommand

func OneOffCommand(executable string, cmd []string)

func RunForValue

func RunForValue(executable string, args []string) string

Types

type AugmentationContext

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

type AugmentationResult

type AugmentationResult struct {
	Input FlagAugmentationInput
	//Stripped []string
	Tombstone bool
	Start     int
	End       int
	Value     string
}

type CommandAugmentationInput

type CommandAugmentationInput struct {
	Name string
	Run  func(args []string)
}

type FlagAugmentationInput

type FlagAugmentationInput struct {
	Name    string
	Erase   bool
	Append  func(match AugmentationResult) string
	Replace func(match AugmentationResult) (string, string)
	After   func(match AugmentationResult)
}

Jump to

Keyboard shortcuts

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