本文整理汇总了C++中poco::util::OptionSet类的典型用法代码示例。如果您正苦于以下问题:C++ OptionSet类的具体用法?C++ OptionSet怎么用?C++ OptionSet使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了OptionSet类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: defineOptions
void HALService::defineOptions(Poco::Util::OptionSet& options) {
Application::defineOptions(options);
options.addOption(
Poco::Util::Option("help", "h", "display help information").required(false).repeatable(false).callback(
Poco::Util::OptionCallback<HALService>(this, &HALService::handleHelp)));
//options.addOption(
// Poco::Util::Option("mode", "m", "virtual or real mode").required(true).repeatable(false)/*.argument("mode=value")*/.callback(
// Poco::Util::OptionCallback<HALService>(this, &HALService::handleMode)));
options.addOption(
Poco::Util::Option("bioradar", "b", "use bio radar").required(false).repeatable(false).argument("bioradar=value").callback(
Poco::Util::OptionCallback<HALService>(this, &HALService::handleBioRadarEnable)));
options.addOption(
Poco::Util::Option("manipulator", "m", "use manipulator").required(false).repeatable(false).argument("manipulator=value").callback(
Poco::Util::OptionCallback<HALService>(this, &HALService::handleManipulatorEnable)));
options.addOption(
Poco::Util::Option("port1", "q1", "manipulator serial port 1 number").required(false).repeatable(false).argument("manport1=value").callback(
Poco::Util::OptionCallback<HALService>(this, &HALService::handleManipulatorPort1)));
options.addOption(
Poco::Util::Option("port2", "q2", "manipulator serial port 2 number").required(false).repeatable(false).argument("manport2=value").callback(
Poco::Util::OptionCallback<HALService>(this, &HALService::handleManipulatorPort2)));
}
示例2: defineOptions
void SubstrApp::defineOptions(Poco::Util::OptionSet& options)
{
ConsoleApp::defineOptions(options);
options.addOption(Poco::Util::Option(
"left", "l", "extract substring at left side.").required(
false).repeatable(false).group("substr").binding(
"smartcube.str.substr.left"));
options.addOption(Poco::Util::Option(
"right", "r", "extract substring at right side.").required(
false).repeatable(false).group("substr").binding(
"smartcube.str.substr.right"));
options.addOption(Poco::Util::Option(
"mid", "m", "extract substring at middle. [default]").required(
false).repeatable(false).group("substr").binding(
"smartcube.str.substr.mid"));
options.addOption(Poco::Util::Option(
"start", "s", "specify start position.").required(
false).repeatable(false).argument("start", true).binding(
"smartcube.str.substr.start"));
options.addOption(Poco::Util::Option(
"size", "n", "specify length of substring.").required(
false).repeatable(false).argument("size", true).binding(
"smartcube.str.substr.size"));
}
示例3: defineOptions
void MainApplication::defineOptions(Poco::Util::OptionSet & options)
{
logger().information("defineOptions");
Poco::Util::ServerApplication::defineOptions(options);
options.addOption(
Poco::Util::Option("help","h","display Help").
required(false).
repeatable(false).
callback(Poco::Util::OptionCallback<MainApplication>(this,&MainApplication::handleHelp))
);
options.addOption(
Poco::Util::Option("client","c","start client services").
required(false).
repeatable(false).
group("client").
callback(Poco::Util::OptionCallback<MainApplication>(this,&MainApplication::handleOption))
);
options.addOption(
Poco::Util::Option("server","s","start server services").
required(false).
repeatable(false).
group("server").
callback(Poco::Util::OptionCallback<MainApplication>(this,&MainApplication::handleOption))
);
}
示例4:
TEST_F(PocoParser_Test, value_with_default_returns_value_if_value_exists)
{
Poco::Util::OptionSet options;
options.addOption(Poco::Util::Option{"test", "t", "", true}.argument("value"));
testee.parse({"--test=hello"}, options);
ASSERT_EQ("hello", testee.value("test", "default"));
}
示例5: defineOptions
void FilterApp::defineOptions(Poco::Util::OptionSet& options)
{
ConsoleApp::defineOptions(options);
options.addOption(Poco::Util::Option(
"and", "a", "filter by and operation.").required(
false).repeatable(false).group("filter").binding(
"smartcube.row.filter.and"));
options.addOption(Poco::Util::Option(
"or", "o", "filter by or operation.").required(
false).repeatable(false).group("filter").binding(
"smartcube.row.filter.or"));
}
示例6: defineOptions
void Server::defineOptions(Poco::Util::OptionSet & _options)
{
_options.addOption(
Poco::Util::Option("help", "h", "show help and exit")
.required(false)
.repeatable(false)
.binding("help"));
_options.addOption(
Poco::Util::Option("version", "V", "show version and exit")
.required(false)
.repeatable(false)
.binding("version"));
BaseDaemon::defineOptions(_options);
}
示例7: defineOptions
void HeadApp::defineOptions(Poco::Util::OptionSet& options)
{
ConsoleApp::defineOptions(options);
options.addOption(Poco::Util::Option(
"groupby", "g", "specify group columns.").required(
false).repeatable(false) .argument("group", true).binding(
"smartcube.agg.head.groupby"));
options.addOption(Poco::Util::Option(
"lines", "n", "specify the number of lines").required(
false).repeatable(false).argument("num").binding(
"smartcube.agg.head.lines"));
}
示例8: defineOptions
void AggAverageApp::defineOptions(Poco::Util::OptionSet& options)
{
ConsoleApp::defineOptions(options);
options.addOption(Poco::Util::Option(
"groupby", "g", "specify group column.").required(
false).repeatable(false) .argument("group", true).binding(
"smartcube.agg.average.groupby"));
options.addOption(Poco::Util::Option(
"showall", "a", "show all rows.").required(
false).repeatable(false).binding(
"smartcube.agg.average.showall"));
}
示例9: defineOptions
virtual void defineOptions(Poco::Util::OptionSet &options) override {
TwitterSubliminalApplication::defineOptions(options);
options.addOption(Poco::Util::Option("blocksize",
"o",
"specify the size of a block [1,20]")
.required(false)
.argument("size")
.binding("blocksize"));
options.addOption(Poco::Util::Option("output",
"p",
"specify file PATH for output; if omitted, output to stdout")
.required(false)
.argument("PATH")
.binding("output_path"));
};
示例10: defineOptions
void MQCheckApplication::defineOptions(Poco::Util::OptionSet& options)
{
Application::defineOptions(options);
options.addOption(Option("help", "h", "display help information on command line arguments").required(false).repeatable(false));
options.addOption(Option("channel", "c", "Server-connection channel").required(false)
.repeatable(false)
.binding("mqcheck.options.channel")
.argument("channelname"));
options.addOption(Option("qmgr", "m", "Queuemanager").required(false)
.repeatable(false)
.binding("mqcheck.options.qmgr")
.argument("name"));
options.addOption(Option("server", "s", "Host and port").required(false)
.repeatable(false)
.binding("mqcheck.options.server")
.argument("host(port)"));
options.addOption(Option("type", "t", "Type of check").required(false)
.repeatable(false)
.binding("mqcheck.options.type")
.argument("type"));
options.addOption(Option("object", "o", "Name of object").required(false)
.repeatable(false)
.binding("mqcheck.options.object")
.argument("name"));
options.addOption(Option("qdepth", "qd", "Queue Depth").required(false)
.repeatable(false)
.binding("mqcheck.options.qdepth")
.argument("number"));
}
示例11: defineOptions
void defineOptions(Poco::Util::OptionSet& options)
{
Poco::Util::ServerApplication::defineOptions(options);
options.addOption(
Poco::Util::Option("help", "h", "display help information on command line arguments")
.required(false)
.repeatable(false));
}
示例12: defineOptions
void ExpApp::defineOptions(Poco::Util::OptionSet& options)
{
ConsoleApp::defineOptions(options);
options.addOption(Poco::Util::Option(
"base", "b", "specify base.").required(
false).repeatable(false) .argument("base", true).binding(
"smartcube.math.exp.base"));
}
示例13: defineOptions
void StripApp::defineOptions(Poco::Util::OptionSet& options)
{
ConsoleApp::defineOptions(options);
options.addOption(Poco::Util::Option(
"left", "l", "strip left side.").required(
false).repeatable(false).group("strip").binding(
"smartcube.str.strip.left"));
options.addOption(Poco::Util::Option(
"right", "r", "strip right side.").required(
false).repeatable(false).group("strip").binding(
"smartcube.str.strip.right"));
options.addOption(Poco::Util::Option(
"both", "b", "strip both sides. [default]").required(
false).repeatable(false).group("strip").binding(
"smartcube.str.strip.both"));
}
示例14: defineOptions
void GtApp::defineOptions(Poco::Util::OptionSet& options)
{
ConsoleApp::defineOptions(options);
options.addOption(Poco::Util::Option(
"numeric", "n", "compare numerics.").required(
false).repeatable(false).group("gt").binding(
"smartcube.log.gt.numeric"));
options.addOption(Poco::Util::Option(
"case-sensitive", "c", "compare strings, case sensitive.").required(
false).repeatable(false).group("gt").binding(
"smartcube.log.gt.string-case-sensitive"));
options.addOption(Poco::Util::Option(
"case-insensitive", "i", "compare strings, case insensitive.").required(
false).repeatable(false).group("gt").binding(
"smartcube.log.gt.string-case-insensitive"));
}
示例15: defineOptions
void ReSplitApp::defineOptions(Poco::Util::OptionSet& options)
{
ConsoleApp::defineOptions(options);
options.addOption(Poco::Util::Option(
"pattern", "p", "specify RE pattern.") .required(
false).repeatable(false).argument("pattern", true) .binding(
"smartcube.col.resplit.pattern"));
options.addOption(Poco::Util::Option(
"match", "m", "use match mode. [default]") .required(
false).repeatable(false).group("resplit") .binding(
"smartcube.col.resplit.match"));
options.addOption(Poco::Util::Option(
"search", "s", "use search mode.") .required(
false).repeatable(false).group("resplit") .binding(
"smartcube.col.resplit.search"));
}