delve/vendor/github.com/cosiner/argv
2020-06-24 10:00:37 -07:00
..
.travis.yml tests: fix typecheckrpc.go and convert it to a test 2019-01-07 11:47:49 -08:00
argv.go Update cosiner/argv to v0.1.0 (#2088) 2020-06-24 10:00:37 -07:00
cmd.go Update cosiner/argv to v0.1.0 (#2088) 2020-06-24 10:00:37 -07:00
go.mod Update cosiner/argv to v0.1.0 (#2088) 2020-06-24 10:00:37 -07:00
LICENSE command/terminal: allow restart to change process args (#1060) 2018-01-18 14:16:11 -08:00
parser.go Update cosiner/argv to v0.1.0 (#2088) 2020-06-24 10:00:37 -07:00
README.md Update cosiner/argv to v0.1.0 (#2088) 2020-06-24 10:00:37 -07:00
scanner.go Update cosiner/argv to v0.1.0 (#2088) 2020-06-24 10:00:37 -07:00

Argv

GoDoc Build Status Coverage Status Go Report Card

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.