tree

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2023 License: MIT Imports: 5 Imported by: 43

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Arg

type Arg struct {
	Name     string
	Repeat   bool
	Optional bool
	Suggest  func(ctx context.Context, t *Root, r *readline.Readline) []prompt.Suggest
}

type Args

type Args []*Arg

func (Args) Last

func (a Args) Last() *Arg

type Flag

type Flag struct {
	Name     string
	Required bool
	Value    interface{}
}

type Node

type Node struct {
	Name             string
	Names            func() []string
	Args             Args
	Flags            func(fs *readline.FlagSet)
	PassThroughArgs  Args
	PassThroughFlags func(fs *readline.FlagSet)
	Description      string
	Nodes            []*Node
	Execute          func(ctx context.Context, r *readline.Readline) error
}

type Nodes

type Nodes []*Node

type Root

type Root struct {
	Name        string
	Description string
	Node        *Node
	Nodes       Nodes
}

func (*Root) RunCompletion added in v0.1.6

func (t *Root) RunCompletion(ctx context.Context, r *readline.Readline) []prompt.Suggest

func (*Root) RunExecution added in v0.1.6

func (t *Root) RunExecution(ctx context.Context, r *readline.Readline) error

Jump to

Keyboard shortcuts

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