opts

package
v0.1.34 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2022 License: Unlicense Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NoOp = func(c interface{}) error { return nil }
View Source
var Tags = func(s ...string) []string {
	return s
}

Functions

This section is empty.

Types

type Command added in v0.1.31

type Command struct {
	Name          string
	Description   string
	Documentation string
	Entrypoint    Op
	Parent        *Command
	Commands      Commands
	Configs       config.Opts
	sync.Mutex
}

Command is a specification for a command and can include any number of subcommands, and for each Command a list of options

func Cmd added in v0.1.33

func Cmd(name, desc, doc string, op Op, cfg map[string]config.Option,
	cmds ...*Command) (c *Command)

func Init added in v0.1.33

func Init(c *Command) *Command

func (*Command) Foreach added in v0.1.32

func (c *Command) Foreach(cl func(*Command, int) bool, hereDepth, hereDist int,
	cmd *Command) (ocl func(*Command, int) bool, depth, dist int,
	cm *Command)

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

func (*Command) MarshalText added in v0.1.32

func (c *Command) MarshalText() (text []byte, err error)

type Commands added in v0.1.31

type Commands []*Command

Commands are a slice of Command entries

type Op added in v0.1.32

type Op func(c interface{}) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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