|
Boost Users : |
From: Andrew Schweitzer (a.schweitzer.grps_at_[hidden])
Date: 2006-04-25 11:22:08
Vladimir Prus wrote:
> Andrew Schweitzer wrote:
> The best you can now is:
>
> parsed_options opts = parse_command_line(......);
> store(opts, vm);
>
> And then iterate over opts.options. Each element has type 'option' which in
> turn has member 'original_tokens'.
>
> - Volodya
Thanks! That works pretty well. Here's the code I tried:
typedef std::vector< basic_option<char> > vec_opt;
cout << "Parsed command line options (from parsed_options):" << endl;
for(vec_opt::iterator l_itrOpt = l_parsed.options.begin();
l_itrOpt != l_parsed.options.end();
++l_itrOpt)
{
basic_option<char>& l_option = *l_itrOpt;
cout << "\t" << l_option.string_key << ": ";
typedef std::vector< std::basic_string<char> > vec_string;
for(vec_string::iterator l_itrString = l_option.value.begin();
l_itrString != l_option.value.end();
++l_itrString)
{
cout << *l_itrString;
}
cout << endl;
}
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