Boost logo

Boost Users :

Subject: Re: [Boost-users] [boost] [program options] Recommended way to specify a list of strings
From: Sanjit Jhala (sjhalaz_at_[hidden])
Date: 2009-12-21 19:37:53


Thanks Ryan, this should work for me.

-Sanjit

On Mon, Dec 21, 2009 at 4:21 PM, Ryan Gallagher <ryan.gallagher_at_[hidden]>wrote:

> Sanjit Jhala <sjhalaz <at> gmail.com> 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:
>
> http://tinyurl.com/yd95h2r
>
> HTH,
>
> -Ryan
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net