Boost :: program_options: how to get application name?

Using the Boost Program options, how do you get the equivalent string argv [0]?

+4
source share
1 answer

I do not think that's possible. This may be due to the fact that the program name can also be legally used as the option name.

The command line analyzer code explicitly skips the corresponding argv member:

 template<class charT> basic_command_line_parser<charT>:: basic_command_line_parser(int argc, charT* argv[]) : detail::cmdline( // Explicit template arguments are required by gcc 3.3.1 // (at least mingw version), and do no harm on other compilers. to_internal(detail::make_vector<charT, charT**>(argv+1, argv+argc+!argc))) {} 
+6
source

All Articles