views:

49

answers:

1

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?

+3  A: 

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.

jamesdlin
Looks like you're right, except I don't need to re-call process(). When the main method is invoked the only arguments left are positional.
lrm