flag

package
v0.0.0-...-2bc9d85 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2021 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ArgRegister   = "register"
	ArgShow       = "show"
	ArgIntrospect = "introspect"
	ArgUpdate     = "update"
)

Variables

This section is empty.

Functions

func SetArgToCmd

func SetArgToCmd(cmd string, arg ProgArg)

func SetHandlerToCmd

func SetHandlerToCmd(cmd string, handlerCmd HandlerType)

func SetUpPreHandler

func SetUpPreHandler(cmd string, handler PreHandlerType)

Types

type HandlerType

type HandlerType func(environment.Environment)

type PreHandlerType

type PreHandlerType func(*environment.Environment)

type ProgArg

type ProgArg struct {
	Hold         interface{}
	DefaultValue interface{} // Set a default value if the arg is not optional
	Name         string
	Description  string
}

func (ProgArg) IsEqual

func (ref ProgArg) IsEqual(toCompare ProgArg) bool

type ProgCmd

type ProgCmd struct {
	Args []ProgArg
	// contains filtered or unexported fields
}

func RetrieveCommand

func RetrieveCommand(env *environment.Environment, args []string) *ProgCmd

func (*ProgCmd) ExecuteHandlers

func (cmd *ProgCmd) ExecuteHandlers(env *environment.Environment)

Jump to

Keyboard shortcuts

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