Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does the Poco C++ Library Support positional command line arguments?

I can see no way to support positional command line arguments with Poco's Poco::Util::Application class and related Poco::Util::OptionProcessor. Positional arguments are unnamed arguments on the command line, coming at the end after all other options, as such:

someprogram -b --what=121 filename.bin

In that example, filename.bin is a positional argument, it has no name, but is the first positional argument after all named arguments. Boost's program_options supports this, and I find it hard to believe Poco does not, but I can't discover how to support it given the source and documentation.

Does Poco support this?

like image 375
Louis Marascio Avatar asked Sep 13 '10 22:09

Louis Marascio


1 Answers

I'm not familiar with Poco, but looking at the documentation, I suspect that the intended usage is to repeatedly call Poco::Util::OptionProcessor::process() on successive elements of argv until it returns false, and that would then signify the start of positional arguments and let you handle them however you wish.

like image 133
jamesdlin Avatar answered Sep 24 '22 15:09

jamesdlin