cli

package
v0.0.0-...-41221c5 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exit

func Exit()

func ExitCode

func ExitCode(code int)

Types

type Command

type Command struct {
	// contains filtered or unexported fields
}

func New

func New(name string, usage string) *Command

func (*Command) AddCommand

func (cmd *Command) AddCommand(name string, help string, init func(*Command))

func (*Command) Error

func (cmd *Command) Error(err error)

func (*Command) Errorf

func (cmd *Command) Errorf(format string, args ...interface{})

func (*Command) Fatal

func (cmd *Command) Fatal(err error)

func (*Command) Fatalf

func (cmd *Command) Fatalf(format string, args ...interface{})

func (*Command) Flag

func (cmd *Command) Flag() *flag.FlagSet

func (*Command) Handle

func (cmd *Command) Handle(handler Handler)

func (*Command) HandleFunc

func (cmd *Command) HandleFunc(handler HandlerFunc)

func (*Command) Run

func (cmd *Command) Run(args []string)

func (*Command) Usage

func (cmd *Command) Usage(usage string)

type Handler

type Handler interface {
	Handle(args []string)
}

type HandlerFunc

type HandlerFunc func(args []string)

func (HandlerFunc) Handle

func (handle HandlerFunc) Handle(args []string)

Jump to

Keyboard shortcuts

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