Documentation
¶
Index ¶
- func GetArgs(argDefs []*CommandArg, flagValues map[string]interface{}) (map[string]interface{}, error)
- func GetBoolArg(args map[string]interface{}, name string) (*bool, error)
- func GetDefaultValue(argDef *CommandArg) interface{}
- func GetIntArg(args map[string]interface{}, name string) (*int, error)
- func GetStringArg(args map[string]interface{}, name string) (*string, error)
- func GetTypeName(argType CommandArgType) string
- func Run(c CommandList, args []string) error
- type Command
- type CommandArg
- type CommandArgType
- type CommandList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetArgs ¶
func GetArgs(argDefs []*CommandArg, flagValues map[string]interface{}) (map[string]interface{}, error)
func GetBoolArg ¶
GetBoolArg gets a bool argument from the flag values
func GetDefaultValue ¶
func GetDefaultValue(argDef *CommandArg) interface{}
func GetStringArg ¶
GetStringArg gets a string argument from the flag values
func GetTypeName ¶
func GetTypeName(argType CommandArgType) string
func Run ¶
func Run(c CommandList, args []string) error
Types ¶
type Command ¶
type Command interface { Name() string Usage() string Args() []*CommandArg Action() func(flagValues map[string]interface{}) error OnExit() func() }
type CommandArg ¶
type CommandArg struct { Name string Type CommandArgType Usage string Required bool Default interface{} }
type CommandList ¶
type CommandList interface {
GetCommands() []Command
}
Directories
¶
Path | Synopsis |
---|---|
generate/initialize
Code generated by github.com/light-speak/lighthouse, YOU CAN FUCKING EDIT BY YOURSELF.
|
Code generated by github.com/light-speak/lighthouse, YOU CAN FUCKING EDIT BY YOURSELF. |
generate/schema
Code generated by github.com/light-speak/lighthouse, YOU CAN FUCKING EDIT BY YOURSELF.
|
Code generated by github.com/light-speak/lighthouse, YOU CAN FUCKING EDIT BY YOURSELF. |
version
Code generated by github.com/light-speak/lighthouse, YOU CAN FUCKING EDIT BY YOURSELF.
|
Code generated by github.com/light-speak/lighthouse, YOU CAN FUCKING EDIT BY YOURSELF. |
Click to show internal directories.
Click to hide internal directories.