[program_options] multitoken

Hello all. Is there any way to get the library to work with the following command line: "--first=11 --first=12" ? So, I want to see the two values for the 'first' option in variable_map, but cant figure out how to do it using program_options features. Thank you in advance.

Alexander Kondratyuk wrote:
Hello all. Is there any way to get the library to work with the following command line: "--first=11 --first=12" ?
So, I want to see the two values for the 'first' option in variable_map, but cant figure out how to do it using program_options features.
Why not have the parameter as: "--first=11,12" instead of trying to create more than one parameter with the same parameter name. Personally because of the type of solution I suggested, which is probably the way most uses of such a multi-value value parameter would look like, with possibly a different separator than a comma, I do not think a parameter library should have to cater to the same parameter name more than once on the command line.
participants (2)
-
Alexander Kondratyuk
-
Edward Diener