Documentation ¶
Index ¶
- Constants
- Variables
- func AddHistory(s string)
- func Cleanup()
- func ClearHistory()
- func FilenameCompleter(query, ctx string) []string
- func GetHistory(i int) string
- func HistorySize() int
- func LoadHistory(path string) error
- func Readline(prompt string) (string, error)
- func SaveHistory(path string) error
- func SetWordBreaks(cs string)
- func Start(info string, project *model.Project)
Constants ¶
const ( AppName = "whatunga" AppVersionMajor = 0 AppVersionMinor = 5 AppVersionMicro = 0 Logo = `` /* 319-byte string literal not displayed */ )
Variables ¶
var AppVersionRev string
revision part of the program version. This will be set automatically at build time by using: go build -ldflags "-X shell.AppVersionRev `date -u +%s`"
var CatchSigint = true
The readline package adds a signal handler for SIGINT at init. If CatchSigint is true, upon receiving the signal (typically from the user pressing Ctrl+C) it will restore the terminal attributes and call os.Exit(1).
Applications that install their own SIGINT handler should set this variable to false, and call Cleanup() manually if the handler causes the application to terminate while a String() call is running.
var Completer = func(query, ctx string) []string { return nil }
This function provides entries for the tab completer.
var CompletionAppendChar = 0
If CompletionAppendChar is non-zero, readline will append the corresponding character to the prompt after each completion. A typical value would be a space.
var Continue = ".."
The continue prompt used by Reader(). The prompt can contain ANSI escape sequences, they will be escaped as necessary.
var Prompt = "> "
The prompt used by Reader(). The prompt can contain ANSI escape sequences, they will be escaped as necessary.
Functions ¶
func Cleanup ¶
func Cleanup()
Cleanup() frees internal memory and restores terminal attributes. This function should be called when program execution stops before the return of a String() call, so as not to leave the terminal in a corrupted state.
If the CatchSigint variable is set to true (default), Cleanup() is called automatically on reception of a SIGINT signal.
func FilenameCompleter ¶
This function can be assigned to the Completer variable to use readline's default filename completion, or it can be called by a custom completer function to get a list of files and filter it.
func Readline ¶
Read a line with the given prompt. The prompt can contain ANSI escape sequences, they will be escaped as necessary.
func SetWordBreaks ¶
func SetWordBreaks(cs string)
Types ¶
This section is empty.