Documentation
¶
Index ¶
Constants ¶
View Source
const (
// DefaultQuotes are the normal quote characters for a command line
DefaultQuotes = "\"'`"
)
Variables ¶
View Source
var ( // ErrNoQuoteTerm is returned when no terminating quote is found in a line. ErrNoQuoteTerm = errors.New("no matching terminating quote found") )
Functions ¶
func Bytes ¶
Bytes parses a line from bytes into a slice of strings. If a character from quotes is encountered then it will add add all into a string until the matching character is found. If not matching terminating quote is found an error is returned.
func Line ¶
Line is similar to LineWithQuotes except it uses DefaultQuotes for the quote characters. Like LineWithQuotes, Runes, and Bytes it will return as error if a quote is encountered but no match is found later.
func LineWithQuotes ¶
LineWithQuotes parses a line line a comand line parser would. It accepts a string of characters that act as quotes used to provided arguments that contain spaces and words.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.