Boost logo

Boost Users :

Subject: Re: [Boost-users] [program_options] Using multitokens
From: Ryan McConnehey (mccorywork_at_[hidden])
Date: 2008-11-07 00:26:05

daniel wrote:
> Now I run into another problem with multitoken:
> In my code I have the following option:
> ("modelparams", po::value<vector<double> >()->multitoken(), "some
> modelparams")
> If I run my program only with
> --modelparams 0.7 1.2 33.0
> everything is fine. But now I would like to append another option:
> --modelparams 0.7 1.2 33.0 --otheroption
> but get the exception:
> "in option 'modelparams ': invalid option value '--otheroption'"
> How can I get this right?
> Daniel
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
I think this is a problem with the program options. Once multitoken is
defined, the program options tried to read everything after the option
as part of the option. For example:

--config file.txt bob fish

If another option is placed after the multitoken, program option doesn't
interpret it as another option but part of the multitoken. For example:

--config file.txt bob fish --send 23

Program options read the above line as all part of the --config option.
Shouldn't multitoken read tokens until the next option is found?


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at