Boost logo

Boost Users :

Subject: Re: [Boost-users] [program_options] Using multitokens
From: Schau,Sönke HG-Dir ae-se (SchauS_at_[hidden])
Date: 2008-11-03 04:20:05


Hi Ryan,
maybe multitoken are only supported in the long form:
--sending 23 5678
have you tried?
Sönke

-----Original Message-----
From: boost-users-bounces_at_[hidden] [mailto:boost-users-bounces_at_[hidden]] On Behalf Of Ryan McConnehey
Sent: Monday, November 03, 2008 6:42 AM
To: Boost-users
Subject: [Boost-users] [program_options] Using multitokens

In the example documentation a multitoken is used for strings as follows:

("email",
boost::program_options::valuevalue<std::string>()->multitoken(), "email
to send to")

This means the command line can have the following option.

--email beadle_at_mars beadle2_at_mars

I'm trying to use the multitoken with an unsigned long as follows:

("sending,s", boost::program_options::value<unsigned
long>()->multitoken(), "Distination node address and port number to
transmit data.")

The command option I would like to use is:

-s 23 6543

When trying to do this the following error occurs.

Unhandled exception: in option 'sending': multiple values not allowed

How do I correctly define a multitoken and then how do I retrieve the
different values?

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