Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrTrailingBackslash = errors.New("trailing backslash")
Error of the POSIX splitters for a backslash ending the input with nothing left to escape
var ErrUnterminatedQuote = errors.New("unterminated quote")
Error of the splitters for a quote that is never closed
Functions ¶
func Join ¶
Arguments quoted for a POSIX shell and joined by single spaces, the first also quoted when bare it would be read as a variable assignment, a reserved word or a job rather than the command it names
func Quote ¶
One argument quoted for a POSIX shell: as is when every byte is a letter, a digit or one of _@%+=:,./- and it does not start with the = that zsh expands to a command path, otherwise in single quotes
func Split ¶
Words of s split the way a POSIX shell splits them: blanks separate words, single quotes keep everything, double quotes keep everything but the backslash escapes of $ ` " \ and newline, a backslash outside quotes keeps the next character, quotes are removed
func SplitCommandLine ¶
Words of a command line written for this host: Split on POSIX systems, SplitRaw on Windows where backslashes separate path elements
func SplitComments ¶
Words of s split as Split does, a # where a word would start beginning a comment that runs to the end of its line
func SplitOperators ¶
Words and shell operators of s split as SplitComments does, unquoted ( ) ; < > | & cut into the longest operators such as && || ;; >> |& and given as tokens of their own
Types ¶
This section is empty.