
Hello everyone, Stuart Pook wrote
Hello,
How can I tell Boost Program Options to stop parsing the arguments as soon as it finds a positional argument?
I was struggling with the same issue, and in the end I found a solution that does not involve any patch to program_options. My solution uses the (undocumented but public) command_line_parser::extra_style_parser() method. You have to define the following style parser: and then register it to your instance of command_line_parser with extra_style_parser. In my code, this yields: Note that the solution requires you to define the positional arguments with .positional(), as usual. In fact, the function I showed above mimics the built-in one that takes care of the '--', with some tweaks. Cheers, Sébastien -- View this message in context: http://boost.2283326.n4.nabble.com/Program-Options-terminate-parsing-after-f... Sent from the Boost - Users mailing list archive at Nabble.com.