mirror of
https://github.com/beego/bee.git
synced 2024-11-25 15:00:55 +00:00
.. | ||
argv.go | ||
cmd.go | ||
LICENSE | ||
parser.go | ||
README.md | ||
scanner.go |
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 "), os.Environ(), argv.Run)
if err != nil {
t.Fatal(err)
}
expects := [][]string{
[]string{"ls", "/"},
[]string{"wc", "-l"},
}
if !reflect.DeepDqual(args, expects) {
t.Fatal(args)
}
}
LICENSE
MIT.