cmds

package
v0.1.16 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2022 License: Unlicense Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	Name        string
	Title       string
	Description string
	Entrypoint  func(c interface{}) error
	Commands    Commands
	Colorizer   func(a ...interface{}) string
	AppText     string
	Parent      *Command
}

Command is a specification for a command and can include any number of subcommands

type Commands

type Commands []Command

Commands are a slice of Command entries

func (Commands) Foreach

func (c Commands) Foreach(cl func(*Command) bool)

Foreach runs a closure on every node in the Commands tree, stopping if the closure returns false

func (Commands) PopulateParents

func (c Commands) PopulateParents(parent *Command)

Jump to

Keyboard shortcuts

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