简体   繁体   English

Poco C ++库是否支持位置命令行参数?

[英]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 . 我看不到用Poco的 Poco::Util::Application类和相关的Poco::Util::OptionProcessor支持位置命令行参数 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. 在该示例中,filename.bin是一个位置参数,它没有名称,但是是所有已命名参数之后的第一个位置参数。 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. Boost的program_options支持这一点,我很难相信Poco不会这样做,但是鉴于源和文档,我无法发现如何支持它。

Does Poco support this? Poco支持吗?

我对Poco不熟悉,但是在查看文档时,我怀疑预期的用法是在argv连续元素上重复调用Poco::Util::OptionProcessor::process() ,直到返回false ,然后表示位置参数的开始,让您随心所欲地处理它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM