Documentation ¶
Index ¶
- Constants
- func BuildCompleter() *readline.PrefixCompleter
- func RegisterCommand(cmd Command)
- type ArgumentDefintion
- type BaseCommand
- func (cmd *BaseCommand) GetCommand() string
- func (cmd *BaseCommand) GetFlags() map[string]bool
- func (cmd *BaseCommand) GetParameter(idx int, defaultValue string) string
- func (cmd *BaseCommand) GetParams() []string
- func (cmd *BaseCommand) IsFlagSet(flag ...string) bool
- func (cmd *BaseCommand) SetFlags(flags map[string]bool)
- func (cmd *BaseCommand) SetParams(params []string)
- type Command
- type FlagDefintion
- type GenericArgumentDefinition
- type GenericFlagDefinition
- type ParamDefinition
Constants ¶
View Source
const ( // CommandCd ... CommandCd = "cd" // CommandClearCache ... CommandClearCache = "clearCache" // CommandLs ... CommandLs = "ls" //CommandDir ... CommandDir = "dir" // CommandHelp ... CommandHelp = "help" // CommandCreate ... CommandCreate = "create" // CommandEcho ... CommandEcho = "echo" // CommandRm ... CommandRm = "rm" // CommandCopy ... CommandCopy = "cp" // CommandWatch ... CommandWatch = "watch" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ArgumentDefintion ¶
type ArgumentDefintion interface { ParamDefinition IsOptional() bool }
ArgumentDefintion ...
type BaseCommand ¶
type BaseCommand struct {
// contains filtered or unexported fields
}
BaseCommand ...
func NewBaseCommand ¶
func NewBaseCommand(cmd string, argDefs []ArgumentDefintion, flagDefs []FlagDefintion) *BaseCommand
NewBaseCommand ...
func (*BaseCommand) GetParameter ¶
func (cmd *BaseCommand) GetParameter(idx int, defaultValue string) string
GetParameter ...
func (*BaseCommand) IsFlagSet ¶
func (cmd *BaseCommand) IsFlagSet(flag ...string) bool
IsFlagSet ...
type Command ¶
type Command interface { GetParameter(idx int, defaultValue string) string GetCommand() string GetParams() []string GetFlags() map[string]bool IsFlagSet(flag ...string) bool SetParams(params []string) SetFlags(flags map[string]bool) Execute(ctx context.Container, buffer *string) (uint, error) Completer(ctx context.Container, input string) []string }
Command ...
func ParseEditorCommand ¶
ParseEditorCommand ...
type FlagDefintion ¶
type FlagDefintion interface { ParamDefinition GetShortName() string GetDefaultValue() interface{} }
FlagDefintion ...
type GenericArgumentDefinition ¶
type GenericArgumentDefinition struct { Name string Description *text.Template Example string Optional bool }
GenericArgumentDefinition ...
func (*GenericArgumentDefinition) GetDescription ¶
func (fd *GenericArgumentDefinition) GetDescription(selection uint) string
GetDescription ...
func (*GenericArgumentDefinition) GetExample ¶
func (fd *GenericArgumentDefinition) GetExample() string
GetExample ...
func (*GenericArgumentDefinition) GetName ¶
func (fd *GenericArgumentDefinition) GetName() string
GetName ...
func (*GenericArgumentDefinition) IsOptional ¶
func (fd *GenericArgumentDefinition) IsOptional() bool
IsOptional ...
type GenericFlagDefinition ¶
type GenericFlagDefinition struct { ShortName string Name string Description *text.Template Example string DefaultValue interface{} }
GenericFlagDefinition ...
func (*GenericFlagDefinition) GetDefaultValue ¶
func (fd *GenericFlagDefinition) GetDefaultValue() interface{}
GetDefaultValue ...
func (*GenericFlagDefinition) GetDescription ¶
func (fd *GenericFlagDefinition) GetDescription(selection uint) string
GetDescription ...
func (*GenericFlagDefinition) GetExample ¶
func (fd *GenericFlagDefinition) GetExample() string
GetExample ...
func (*GenericFlagDefinition) GetName ¶
func (fd *GenericFlagDefinition) GetName() string
GetName ...
func (*GenericFlagDefinition) GetShortName ¶
func (fd *GenericFlagDefinition) GetShortName() string
GetShortName ...
Source Files ¶
Click to show internal directories.
Click to hide internal directories.