cli

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Name
	Version string
	// contains filtered or unexported fields
}

func NewApp

func NewApp(name string, version string, flags ...any) *App

func (*App) PreRun

func (a *App) PreRun(ctx context.Context) context.Context

func (*App) Run

func (a *App) Run(ctx context.Context, args []string) error

type CanPreRun

type CanPreRun interface {
	PreRun(ctx context.Context) context.Context
}

type Command

type Command interface {
	Naming() *Name
	Run(ctx context.Context, args []string) error
}

type Name

type Name struct {
	Name      string
	Desc      string
	ValidArgs ValidArgs
	// contains filtered or unexported fields
}

func (*Name) Add

func (n *Name) Add(c Command)

func (*Name) Naming

func (n *Name) Naming() *Name

type ValidArgs

type ValidArgs []string

func ParseValidArgs

func ParseValidArgs(s string) ValidArgs

func (ValidArgs) HasVariadic

func (as ValidArgs) HasVariadic() bool

func (ValidArgs) Validate

func (as ValidArgs) Validate(args []string) error

Jump to

Keyboard shortcuts

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