Boost logo

Boost Users :

From: Christian Henning (chhenning_at_[hidden])
Date: 2007-07-16 21:49:34


Hi there, I cannot get the short option name feature to work. For some
reason an exception is being thrown when I use the short name.

I'm using boost 1.34 on MSVC 8.

Here is what I'm doing:

#include <boost\program_options.hpp>

using namespace std;
using namespace boost;
namespace po = boost::program_options;

int main( int argc, char* argv[] )
{
   string input;

   po::options_description settings( "" );
   settings.add_options()
      ( "input,I"
      , po::value< string >( &input )
            ->default_value( "" )
      , "" );

   po::options_description options;
   options.add( settings );

   po::variables_map variables;

   store( parse_command_line( argc
                            , argv
                            , settings )
         , variables );

   notify( variables );

   cout << input << endl;

        return 0;
}

Using --input="hello" works but not -I="hello". What am I overlooking?

Thanks ahead,
Christian


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