Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommandEquals ¶
CommandEquals checks whether the text given matches either the name of the given command or one of it's aliases.
func ParseCommand ¶
ParseCommand takes an arbitrary input string and splits it into parameters. The first parameter (index 0) will always be the command itself.
func PrintError ¶
PrintError message writes an error to the given io.Writer in the default format, using the correct colors and punctuation.
Types ¶
type ClientState ¶
type Command ¶
type Command interface { // Execute runs the command piping its output into the supplied writer. Execute(writer io.Writer, parameters []string) // PrintHelp prints a static help page for this command PrintHelp(writer io.Writer) // Name returns the primary name for this command. This name will also be // used for listing the command in the commandlist. Name() string // Aliases are a list of aliases for this command. There might be none. Aliases() []string }
Command represents a command that is executable by the user.
Click to show internal directories.
Click to hide internal directories.