cli

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2025 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrArgInvalid means invalid args.
	ErrArgInvalid = errors.New("cli: invalid arg specified")

	// ErrArgNone means no args.
	ErrArgNone = errors.New("cli: no args specified")
)

Functions

func Run

func Run(sub Sub) (*cmd.State, error)

Run boots and then starts the cmdfn from given subcmd.

Types

type Cmd

type Cmd struct {
	Help error
	Min  int
	Sub  Sub
	Fn   fn
	// contains filtered or unexported fields
}

Cmd represents a cmd.

type Sub added in v1.0.2

type Sub map[string]*Cmd

Sub represents subcmd layout.

func (Sub) Print added in v1.0.2

func (sub Sub) Print() error

Print prints logo and helps.

func (Sub) Route added in v1.0.2

func (sub Sub) Route() (*Cmd, error)

Route returns follow up cmd for given subcmd.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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