clipp
clipp copied to clipboard
How to specify number of times a value can be repeated
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)