Boost logo

Boost Users :

Subject: Re: [Boost-users] [boost] [program options] Recommended way to specify a list of strings
From: Ryan Gallagher (ryan.gallagher_at_[hidden])
Date: 2009-12-21 19:21:32

Sanjit Jhala <sjhalaz <at>> writes:
> Say I want to specify a list of servers via the boost program_options
> library. Something like:
> --total-servers N --server srv1 --server srv2 ... --server srvN
> How would I do this?

Have you tried sending a std::vector<std::string> as the option value?

("server", po::value< vector<string> >()

See the "Option Details" section in the tutorial:



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