opts

package
v0.1.37 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2022 License: Unlicense Imports: 17 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) GetOpt added in v0.1.36

func (c *Command) GetOpt(path Path) (o config.Option)

func (*Command) MarshalText added in v0.1.32

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

func (*Command) UnmarshalText added in v0.1.35

func (c *Command) UnmarshalText(t []byte) (err error)

type Commands added in v0.1.31

type Commands []*Command

Commands are a slice of Command entries

type Entries added in v0.1.35

type Entries []Entry

func (Entries) Len added in v0.1.35

func (e Entries) Len() int

func (Entries) Less added in v0.1.35

func (e Entries) Less(i, j int) bool

func (Entries) Swap added in v0.1.35

func (e Entries) Swap(i, j int)

type Entry added in v0.1.35

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

func (Entry) String added in v0.1.35

func (e Entry) String() string

type Op added in v0.1.32

type Op func(c interface{}) error

type Path added in v0.1.35

type Path []string

func (Path) String added in v0.1.35

func (p Path) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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