[program_options] multitoken arguments

Dears, we've been using boost::program_options and it works great. We just found a minor thing, which could be an issue, and I'm reporting it to you: when specifying and using a multitoken argument, it actually works only if put as last parameter of command line; in any other case, it eats all remaining parameters. My specification is as follows: desc.add_options() ("output,o", bpo::value<std::vector<std::string> >()->multitoken(), "use output setup for discovery/scan"); If then I want to use it like follows, it works:
fing -p1 -p2 -p3 -o 1 2 3
But if the user inverts the order, it does not work anymore, meaning that p3 is eaten by -o option.
fing -p1 -p2 -o 1 2 3 -p3
Is this a known limitation? Or maybe my specification above is not correct? Thanks in advance, Carlo Medas

Carlo Medas wrote:
Dears, we've been using boost::program_options and it works great.
We just found a minor thing, which could be an issue, and I'm reporting it to you: when specifying and using a multitoken argument, it actually works only if put as last parameter of command line; in any other case, it eats all remaining parameters.
My specification is as follows:
desc.add_options() ("output,o", bpo::value<std::vector<std::string> >()->multitoken(), "use output setup for discovery/scan");
If then I want to use it like follows, it works:
fing -p1 -p2 -p3 -o 1 2 3
But if the user inverts the order, it does not work anymore, meaning that p3 is eaten by -o option.
fing -p1 -p2 -o 1 2 3 -p3
Is this a known limitation?
Yes. Can you try SVN HEAD version -- it should have this fixed. - Volodya

Thanks Volodya, we've been using latest boost 1.38.0 (testing it on Win, Linux, Mac). I checked SVN HEAD but it seems to me that there hasn't been recent activity after 1.38.0, or am I missing something? Thanks in advance. Kind regards, \Carlo On Fri, Apr 3, 2009 at 3:44 PM, Vladimir Prus <vladimir@codesourcery.com>wrote:
Carlo Medas wrote:
Dears, we've been using boost::program_options and it works great.
We just found a minor thing, which could be an issue, and I'm reporting it to you: when specifying and using a multitoken argument, it actually works only if put as last parameter of command line; in any other case, it eats all remaining parameters.
My specification is as follows:
desc.add_options() ("output,o", bpo::value<std::vector<std::string> >()->multitoken(), "use output setup for discovery/scan");
If then I want to use it like follows, it works:
fing -p1 -p2 -p3 -o 1 2 3
But if the user inverts the order, it does not work anymore, meaning that p3 is eaten by -o option.
fing -p1 -p2 -o 1 2 3 -p3
Is this a known limitation?
Yes. Can you try SVN HEAD version -- it should have this fixed.
- Volodya
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Carlo Medas wrote:
Thanks Volodya, we've been using latest boost 1.38.0 (testing it on Win, Linux, Mac). I checked SVN HEAD but it seems to me that there hasn't been recent activity after 1.38.0, or am I missing something?
Uhm, I have managed to commit this fix to release branch: https://svn.boost.org/trac/boost/changeset/52154 I'll put it on trunk shortly. - Volodya

Thank you very much once again, Volodya, for your prompt and precious support. Carlo On Mon, Apr 6, 2009 at 11:33 AM, Vladimir Prus <vladimir@codesourcery.com>wrote:
Carlo Medas wrote:
Thanks Volodya, we've been using latest boost 1.38.0 (testing it on Win, Linux, Mac). I checked SVN HEAD but it seems to me that there hasn't been recent activity after 1.38.0, or am I missing something?
Uhm, I have managed to commit this fix to release branch:
https://svn.boost.org/trac/boost/changeset/52154
I'll put it on trunk shortly.
- Volodya
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
participants (2)
-
Carlo Medas
-
Vladimir Prus