Documentation ¶ Index ¶ Variables type Arg type Args func (a Args) Last() *Arg func (a Args) Validate(args readline.Args) error type Node type Nodes type Root func New(node *Node) Root Constants ¶ This section is empty. Variables ¶ View Source var ( ErrNoop = errors.New("noop") ErrInvalidCommand = errors.New("invalid command") ErrMissingCommand = errors.New("missing command") ErrMissingArgument = errors.New("missing argument") ) Functions ¶ This section is empty. Types ¶ type Arg ¶ type Arg struct { Name string Description string Repeat bool Optional bool Suggest func(ctx context.Context, t Root, r *readline.Readline) []goprompt.Suggest } type Args ¶ type Args []*Arg func (Args) Last ¶ func (a Args) Last() *Arg func (Args) Validate ¶ added in v0.4.0 func (a Args) Validate(args readline.Args) error type Node ¶ type Node struct { Name string Values func(ctx context.Context, r *readline.Readline) []goprompt.Suggest Args Args Flags func(ctx context.Context, r *readline.Readline, fs *readline.FlagSets) error Description string Nodes []*Node Execute func(ctx context.Context, r *readline.Readline) error } type Nodes ¶ type Nodes []*Node type Root ¶ type Root interface { Node() *Node Complete(ctx context.Context, r *readline.Readline) []goprompt.Suggest Execute(ctx context.Context, r *readline.Readline) error Help(ctx context.Context, r *readline.Readline) string } func New ¶ added in v0.4.0 func New(node *Node) Root Source Files ¶ View all Source files arg.go args.go errors.go node.go nodes.go root.go Click to show internal directories. Click to hide internal directories.