Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ellipsis not working for anything but strings #68

Open
codesoap opened this issue Jul 29, 2019 · 0 comments
Open

Ellipsis not working for anything but strings #68

codesoap opened this issue Jul 29, 2019 · 0 comments

Comments

@codesoap
Copy link

Suppose I have this program:

package main

import (
	`fmt`
	`github.com/docopt/docopt-go`
)

func main() {
	opts, _ := docopt.ParseDoc(`
		Usage:
		    mytool --number=<num>...`)

	var conf struct {
		Number []int
	}
	if err := opts.Bind(&conf); err != nil {
		panic(err)
	}

	fmt.Printf("%v\n", conf)
}

When executing go run mytool.go I get this error:

panic: value of "--number" is not assignable to "Number" field

goroutine 1 [running]:
main.main()
        /<path_to_script>/mytool.go:17 +0x190
exit status 2

If I change []int to []string everything works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant