# README
Argv
Argv is a library for Go to split command line string into arguments array.
Documentation
Documentation can be found at Godoc
Example
func TestArgv(t *testing.T) {
args, err := argv.Argv([]rune(" ls `echo /` | wc -l "), argv.ParseEnv(os.Environ()), argv.Run)
if err != nil {
t.Fatal(err)
}
expects := [][]string{
[]string{"ls", "/"},
[]string{"wc", "-l"},
}
if !reflect.DeepEqual(args, expects) {
t.Fatal(args)
}
}
LICENSE
MIT.
# Functions
Argv split cmdline string as array of argument array by the '|' character.
No description provided by the author
NewParser create a cmdline string parser.
NewScanner create a scanner and init it's internal states.
No description provided by the author
Scan is a utility function help split input text as tokens.
# Constants
TokBackQuote is reverse quoted string.
TokEOF means the input end.
TokPipe is the '|' character.
TokSpace represent space character sequence.
TokString for string.
No description provided by the author
No description provided by the author
# Variables
ErrInvalidSyntax was reported if there is a syntax error in command line string.