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

Support one or more, and zero or more for slice options #13

Open
macfisherman opened this issue Mar 28, 2023 · 1 comment
Open

Support one or more, and zero or more for slice options #13

macfisherman opened this issue Mar 28, 2023 · 1 comment

Comments

@macfisherman
Copy link

From Getopt::Long:

It is also possible to specify the minimal and maximal number of arguments an option takes. foo=s{2,4} indicates an option that takes at least two and at most 4 arguments. foo=s{1,} indicates one or more values; foo:s{,} indicates zero or more option values.

@DavidGamba
Copy link
Owner

For the 1 or more I normally define 1, 99. Since go is strongly typed I wouldn't want to change the max definition to any other type than int, so defining your arbitrarily large value should do it.

For the zero or more, could you provide an example of how you want to use it in practice?

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

No branches or pull requests

2 participants