[program_options] How do I read a vector of strings?
Hello,
I have been using program_options for a while and it works great.
However, I don't know how to make a program which behaves like this:
programname -blah abc -blah def -blah ghi
In my code I would read the option blah as a vector of strings, like:
po::options_description desc("Configuration");
desc.add_options()
("blah",
po::value
On Fri, 21 Jan 2005 15:50:19 -0600, Matthew P. Cashdollar
Hello,
I have been using program_options for a while and it works great. However, I don't know how to make a program which behaves like this:
programname -blah abc -blah def -blah ghi
In my code I would read the option blah as a vector of strings, like:
po::options_description desc("Configuration"); desc.add_options() ("blah", po::value
(), "the location of the blah device") ; po::store(po::parse_config_file(config_file, desc), vm); po::notify(vm); etc.
When I try to compile the code under MSVC++ 7.0 I get this error (among others):
error C2947: expecting '>' to terminate template-argument-list, found '>>'
Is it possible for me to do what I am trying to with the program_options library?
Thanks, -Matt
Instead of 'po::value
At Friday 2005-01-21 14:50, you wrote:
Hello,
I have been using program_options for a while and it works great. However, I don't know how to make a program which behaves like this:
programname -blah abc -blah def -blah ghi
In my code I would read the option blah as a vector of strings, like:
po::options_description desc("Configuration"); desc.add_options() ("blah", po::value
(), "the location of the blah device") ; po::store(po::parse_config_file(config_file, desc), vm); po::notify(vm); etc.
When I try to compile the code under MSVC++ 7.0 I get this error (among others):
error C2947: expecting '>' to terminate template-argument-list, found '>>'
yeah, put a space between the > and the > in the
line po::value
Is it possible for me to do what I am trying to with the program_options library?
Thanks, -Matt _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Victor A. Wagner Jr. http://rudbek.com The five most dangerous words in the English language: "There oughta be a law"
participants (3)
-
Matthew P. Cashdollar
-
Stuart Dootson
-
Victor A. Wagner Jr.