Documentation ¶
Index ¶
- func Escape(s string) string
- func EscapeBytes(s []byte) []byte
- func EscapeBytesNoQuotes(s []byte) []byte
- func EscapeNoQuotes(s string) string
- func IsCommandSeparator(text string) bool
- func Split(text string) []string
- func Unescape(text string) string
- func UnescapeBytes(b []byte) []byte
- func UnescapeCLike(text string, buffer *bytes.Buffer, pos int) int
- type BashProxy
- type Proxy
- type Token
- type ZshProxy
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EscapeBytesNoQuotes ¶
Escape escapes a byte array with backslashes.
func EscapeNoQuotes ¶
Escape escapes a string with backslashes.
func IsCommandSeparator ¶
func Split ¶
Split splits a whole command line into tokens. Example: "cat fi\ le.txt|grep -V ^# >'out$$.txt' # Find non-comment lines." -> output: cat, fi\ le.txt, |, grep, -V, ^#, >, 'out$$.txt', # Find non-comment lines.
func UnescapeBytes ¶
Types ¶
type BashProxy ¶
type BashProxy struct { }
func (*BashProxy) GetCommandLine ¶
GetCommandLine return the current command line and the cursor position from the READLINE_* environmental variables.
func (*BashProxy) PrintUpdateCommandLineEvalStr ¶
PrintUpdateCommandLineEvalStr prints a string that can be evaled by bash to update the READLINE_* environmental variables to update the current command line.
type Proxy ¶
type Proxy interface { GetCommandLine() (commandLine string, cursorPos int) PrintUpdateCommandLineEvalStr(commandLine string, cursorPos int) Split(text string) []Token Escape(text string) string Unescape(text string) string }
func GetBashProxy ¶
func GetBashProxy() Proxy
func GetSupportedProxy ¶
func GetSupportedProxy() Proxy
func GetZshProxy ¶
func GetZshProxy() Proxy
func MustGetSupportedProxy ¶
func MustGetSupportedProxy() Proxy
type Token ¶
func SplitToTokens ¶
type ZshProxy ¶
type ZshProxy struct { }
func (*ZshProxy) GetCommandLine ¶
func (*ZshProxy) PrintUpdateCommandLineEvalStr ¶
Click to show internal directories.
Click to hide internal directories.