Documentation ¶
Index ¶
- Variables
- func Active() bool
- func EnableHelp(about string)
- func HandleCommand(str string)
- func Println(args ...interface{})
- func Quit()
- func RePrintln(args ...interface{})
- func ReadLine(text string, def string) string
- func Register(cmd Command) error
- func SetActive(b bool)
- func SetText(str string)
- func Start(enableAutocomplete bool) error
- func Text() string
- type Command
Constants ¶
This section is empty.
Variables ¶
View Source
var CommandList []Command
CommandList of all registered commands
Functions ¶
func EnableHelp ¶
func EnableHelp(about string)
EnableHelp registers help command with optional 'about' string at the top
func HandleCommand ¶
func HandleCommand(str string)
HandleCommand parses string for command/args and calls callback if command exists
func RePrintln ¶
func RePrintln(args ...interface{})
RePrintln reprints the last line, useful for updating progress
func ReadLine ¶
ReadLine waits for user input and returns as string. Temporarily changes prompt text and returns default value on empty input
Types ¶
type Command ¶
type Command struct { Aliases []string // one or many aliases this command can be called by Callback func(string) // callback function, takes the inputted arguments as a string Help string // for help command, first line is used when listing all commands Hidden bool // hides command from help list }
Command data for a single command
Click to show internal directories.
Click to hide internal directories.