Documentation ¶
Overview ¶
Package argv parse command line string into arguments array using the bash syntax.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidSyntax was reported if there is a syntax error in command line string. ErrInvalidSyntax = errors.New("invalid syntax") )
Functions ¶
Types ¶
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser take tokens from Scanner, and do syntax checking, and generate the splitted arguments array.
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
Scanner is a cmdline string scanner.
It split cmdline string to tokens: space, string, pipe, reverse quote string.
func NewScanner ¶
NewScanner create a scanner and init it's internal states.
Click to show internal directories.
Click to hide internal directories.