cli

package
v0.0.33 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2023 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CLI

type CLI struct {
	Args     []string
	Commands Commands
	Name     string
	Version  string
	HelpFunc HelpFunc
	// contains filtered or unexported fields
}

func NewCLI

func NewCLI(name, version string) *CLI

func (*CLI) IsHelp

func (c *CLI) IsHelp() bool

func (*CLI) Run

func (c *CLI) Run() (int, error)

func (*CLI) SubCommand

func (c *CLI) SubCommand() string

func (*CLI) SubCommandArgs

func (c *CLI) SubCommandArgs() []string

type Command

type Command interface {
	Run(args []string) int
	Help() string
	Synopsis() string
}

type Commands

type Commands map[string]Command

type HelpFunc

type HelpFunc func(Commands) string

func BasicHelpFunc

func BasicHelpFunc(name string) HelpFunc

Jump to

Keyboard shortcuts

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