commands

package
v0.2.17 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Registry = map[string]*CommandHandler{}

Functions

func BuildCobraCommands

func BuildCobraCommands(ctx *ExecContext) []*cobra.Command

func Dispatch

func Dispatch(ctx *ExecContext, name string, args []string) error

func Register

func Register(handler *CommandHandler) error

Types

type CommandHandler

type CommandHandler struct {
	Name               string
	Aliases            []string
	Usage              string
	Description        string
	DisableFlagParsing bool
	Run                func(ctx *ExecContext, args []string) error
}

type ExecContext

type ExecContext struct {
	Vars     map[string]any
	EnvName  string
	EnvPath  string
	Output   io.Writer
	InREPL   bool
	OpenREPL func(ctx *ExecContext) error
}

Jump to

Keyboard shortcuts

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