Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CommandSet ¶
type CommandSet struct { // contains filtered or unexported fields } //strutct
CommandSet is a set of commands.
func NewCommandSet ¶
func NewCommandSet(partial bool) *CommandSet
NewCommandSet creates a new CommandSet. The commands can either be determined strictly or partially from the command line via the provided bool.
func (*CommandSet) Add ¶
func (c *CommandSet) Add(command string, action Executor)
Add an Executor to the CommandSet.
func (CommandSet) CheckLine ¶
func (c CommandSet) CheckLine(line string) (bool, error)
CheckLine checks if the can be executed. If not false is returned. If the line is associated with a command the command will be executed and true returned. If the command encounters an error or parsing the line results in and error, it will be returned.
Click to show internal directories.
Click to hide internal directories.