Documentation ¶
Index ¶
- func ExecuteExit()
- type Action
- type Command
- type CommandConfiguration
- type CommandMap
- type CommandsConfiguration
- type ExecutionPlan
- type Shell
- func (s *Shell) ConfigMap(configuration *CommandsConfiguration) *Shell
- func (s *Shell) Help()
- func (s *Shell) Input() string
- func (s *Shell) LoadConfiguration(configFile string) *Shell
- func (s *Shell) SetActions(actions map[string]func()) *Shell
- func (s *Shell) SetActionsStrings(actions map[string]func([]string)) *Shell
- func (s *Shell) SetConfiguration(configuration *CommandsConfiguration) *Shell
- func (s *Shell) SetPrompt(name string) *Shell
- func (s *Shell) Start()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Action ¶
type Action struct { Function func() InputFunction func([]string) }
func NewInputAction ¶
type Command ¶
func (Command) ExecuteWith ¶
type CommandConfiguration ¶
type CommandMap ¶
func (*CommandMap) Lookup ¶
func (m *CommandMap) Lookup(plan string) *Command
type CommandsConfiguration ¶
type CommandsConfiguration struct {
CommandList []CommandConfiguration `yaml:"commands"`
}
func LoadCommands ¶
func LoadCommands(configFile string) *CommandsConfiguration
type ExecutionPlan ¶
func Prepare ¶
func Prepare(plan string) *ExecutionPlan
func (*ExecutionPlan) Execute ¶
func (e *ExecutionPlan) Execute()
func (*ExecutionPlan) With ¶
func (e *ExecutionPlan) With(command *Command) *ExecutionPlan
type Shell ¶
type Shell struct { Prompt string Suggestions []prompt.Suggest CommandMap *CommandMap ActionMap map[string]func() ActionOneStringMap map[string]func([]string) }
func (*Shell) ConfigMap ¶
func (s *Shell) ConfigMap(configuration *CommandsConfiguration) *Shell
func (*Shell) LoadConfiguration ¶
func (*Shell) SetActions ¶
func (*Shell) SetActionsStrings ¶
func (*Shell) SetConfiguration ¶
func (s *Shell) SetConfiguration(configuration *CommandsConfiguration) *Shell
Source Files ¶
Click to show internal directories.
Click to hide internal directories.