• Stars
    star
    41
  • Rank 645,260 (Top 14 %)
  • Language
    Go
  • License
    MIT License
  • Created over 7 years ago
  • Updated about 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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(" ls   `echo /`   |  wc  -l ", func(backquoted string) (string, error) {
		return backquoted, nil
	}, nil)
	if err != nil {
		t.Fatal(err)
	}
	expects := [][]string{
		[]string{"ls", "echo /"},
		[]string{"wc", "-l"},
	}
	if !reflect.DeepEqual(args, expects) {
		t.Fatal(args)
	}
}

LICENSE

MIT.