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

How to specify number of times a value can be repeated #39

Open
mpflanzer opened this issue Nov 22, 2019 · 0 comments
Open

How to specify number of times a value can be repeated #39

mpflanzer opened this issue Nov 22, 2019 · 0 comments

Comments

@mpflanzer
Copy link

What is the best way to achieve a command line like the following:

exe fetch <origin> <origin> <origin>

The number of origins should be fixed to a given number.

The only way I could come up with after reading the documentation would be something like this:

std::string origin1, origin2, origin3;
command("fetch"), value("origin", origin1), value("origin", origin2), value("origin", origin3)

Is there any better way as this feels a bit clumsy? I was expecting something along these lines:

std::vector<std::string> origins;
command("fetch"), values(3, "origin", origins)
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