program_options: how to retrieve positional options

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

program_options: how to retrieve positional options

Dean Sturtevant

Let's say one has defined the following:

  boost::program_options::positional_options_description pdesc;
         pdesc.add("generic_name", -1);

Then included it in the parse:

        boost::program_options::variables_map options_map;

         boost::program_options::basic_parsed_options<char> options =
             boost::program_options::basic_command_line_parser<char>(argc,  
argv).
             positional(pdesc).run();
         po::store(options, options_map);
         po::notify(options_map);

How does one retrieve the positional options?

- Dean
_______________________________________________
Boost-users mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: program_options: how to retrieve positional options

Olaf van der Spek-2
On Fri, 14 Apr 2006 13:37:35 -0400, "Dean Sturtevant"
<[hidden email]> wrote:

>
>Let's say one has defined the following:
>
>  boost::program_options::positional_options_description pdesc;
>         pdesc.add("generic_name", -1);
>
>Then included it in the parse:
>
> boost::program_options::variables_map options_map;
>
>         boost::program_options::basic_parsed_options<char> options =
>             boost::program_options::basic_command_line_parser<char>(argc,
>argv).
>             positional(pdesc).run();
>         po::store(options, options_map);
>         po::notify(options_map);
>
>How does one retrieve the positional options?

Isn't it just like a normal option with the name "generic_name"?
_______________________________________________
Boost-users mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users