Boost logo

Boost Users :

From: Varun Yagain (RBIN/ECM4) (Varun.Yagain_at_[hidden])
Date: 2007-11-26 00:11:45


> Swapna [swapna0282_at_[hidden]] wrote:
> Can we have more than one value added to positional_options_description ie
> positional_options_description posOpt;
> posOpt.add( "A", -1 );
> posOpt.add( "B", -1 );
> posOpt.add( "C", -1 );

from <http://www.boost.org/doc/html/program_options/overview.html#id1591885>
http://www.boost.org/doc/html/program_options/overview.html#id1591885
on positional_options_description<http://www.boost.org/doc/html/boost/program_options/positional_options_description.html> - "specifies translation from position to name".

So I am not sure if you mean you want to only add more than one value -
which the tutorial very well explains;
or add more than one value to the same position - which would be absurd.

For code like:
=============================================
 optdesc.add_options()
     ("input-files-1,i", po::value< vector< string > >(&input_file_1),
         "Input file name." )
     ("input-files-2,i", po::value< vector< string > >(&input_file_2),
         "Input file name." )
     ("input-files-3,i", po::value< vector< string > >(&input_file_3),
         "Input file name." )
 ;
 po::positional_options_description posopt;
 posopt.add("input-files-1", -1);
 posopt.add("input-files-2", -1);
 posopt.add("input-files-3", -1);

all positional values given at command line would be
assigned to "input-files-3".
=============================================

- Varun Yagain.



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