cli

package
v0.0.0-...-5abfbfe Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2022 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionFunc

type ActionFunc func(*Context) error

type App

type App struct {
	Name     string
	Usage    string
	Commands []*Command
	Action   ActionFunc
}

func (*App) FindCommand

func (a *App) FindCommand(name string) *Command

func (*App) Run

func (a *App) Run(args []string) error

type Command

type Command struct {
	Name   string
	Usage  string
	Action ActionFunc
}

func (*Command) Run

func (c *Command) Run(ctx *Context) error

type Context

type Context struct {
	App     *App
	Command *Command
	Args    []string
}

func (*Context) HasArgs

func (c *Context) HasArgs() bool

Jump to

Keyboard shortcuts

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