Boost logo

Boost Users :

From: Liam Routt (caligari_at_[hidden])
Date: 2005-11-20 18:50:18


Merrill Cornish wrote:
> // specify the single, required graph file positional parameter
> po::positional_options_description pd;
> pd.add("graph_file", 1);
>
> po::variables_map vm;
> po::store(parse_command_line(argc, argv, desc), vm);
> po::notify(vm);

Perhaps I am missing something, but I don't see where pd is included in
the call to po::store().

My own code includes the following line (I think you can follow the
various variable names; I have a class holding all the option
descriptions, here refrenced as "opts"):

         store(po::command_line_parser(argc, argv).
                   options(opts.commandline).
                   positional(opts.positional).
                   run(),
               configmap);

I think I found I had to use command_line_parser() and its more
explicit syntax (rather than the easier parse_command_line()) when using
positional arguments.

Take care,

Liam

--
Liam Routt                                          Ph: (03) 8344-1315
Research Programmer                               caligari_at_[hidden]
Computer Science, Melbourne University              (or liam_at_[hidden])

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