Boost logo

Boost Users :

From: Alexandre Gacon (alexandre.gacon_at_[hidden])
Date: 2006-01-05 11:45:34


No, all the args start with a single ‘-‘.

 

For example, with the following code:

 

    po::options_description desc;

    desc.add_options()

        ( "config-file", po::value< std::string >( & strConfigFile
)->default_value( defaultConfigFilePath.native_file_string() ) );

 

I am able to call my program with a –config-file my_config_file.cfg command
line.

 

Alexandre

 

  _____

De : boost-users-bounces_at_[hidden]
[mailto:boost-users-bounces_at_[hidden]] De la part de Guy Peled
Envoyé : jeudi 5 janvier 2006 17:21
À : boost-users_at_[hidden]
Objet : [Boost-users] [Boost.Program_options] Is there a way to have
alloptions specifiedwith a single dash instead of double?

 

I'm interested in switching over the command line processing of an existing
tool to use program_options.
However, all of the args are of the format '-foo -bar -whatever 1' etc.
As far as I can tell from the docs it seems like by default the
program_options library assumes args all start with a '--' or have single
character short names that start with a single dash. Is there a way to
coerce it into the behavior I'm looking for?

Thanks for any tips!
Guy.

 

_________________________________________________________________

Guy Peled Email gpeled_at_[hidden]
3D/Tools Architect 408-486-2505
nVIDIA 2701 San Tomas Expressway
 <file:///\\www.nvidia.com> www.nvidia.com Santa Clara, CA 95050

_________________________________________________________________

 



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