本文整理汇总了C++中moe::OptionSection::addPositionalOption方法的典型用法代码示例。如果您正苦于以下问题:C++ OptionSection::addPositionalOption方法的具体用法?C++ OptionSection::addPositionalOption怎么用?C++ OptionSection::addPositionalOption使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类moe::OptionSection
的用法示例。
在下文中一共展示了OptionSection::addPositionalOption方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addMongoShellOptions
//.........这里部分代码省略.........
"username for authentication" , true));
if (!ret.isOK()) {
return ret;
}
ret = options->addOption(OD("password", "password,p", moe::String,
"password for authentication" , true, moe::Value(), moe::Value(std::string(""))));
if (!ret.isOK()) {
return ret;
}
ret = options->addOption(OD("authenticationDatabase", "authenticationDatabase", moe::String,
"user source (defaults to dbname)" , true, moe::Value(std::string(""))));
if (!ret.isOK()) {
return ret;
}
ret = options->addOption(OD("authenticationMechanism", "authenticationMechanism", moe::String,
"authentication mechanism", true, moe::Value(std::string("MONGODB-CR"))));
if (!ret.isOK()) {
return ret;
}
ret = options->addOption(OD("help", "help,h", moe::Switch, "show this usage information",
true));
if (!ret.isOK()) {
return ret;
}
ret = options->addOption(OD("version", "version", moe::Switch, "show version information",
true));
if (!ret.isOK()) {
return ret;
}
ret = options->addOption(OD("verbose", "verbose", moe::Switch, "increase verbosity", true));
if (!ret.isOK()) {
return ret;
}
ret = options->addOption(OD("ipv6", "ipv6", moe::Switch,
"enable IPv6 support (disabled by default)", true));
if (!ret.isOK()) {
return ret;
}
#ifdef MONGO_SSL
ret = options->addOption(OD("ssl", "ssl", moe::Switch, "use SSL for all connections", true));
if (!ret.isOK()) {
return ret;
}
ret = options->addOption(OD("ssl.CAFile", "sslCAFile", moe::String,
"Certificate Authority for SSL" , true));
if (!ret.isOK()) {
return ret;
}
ret = options->addOption(OD("ssl.PEMKeyFile", "sslPEMKeyFile", moe::String,
"PEM certificate/key file for SSL" , true));
if (!ret.isOK()) {
return ret;
}
ret = options->addOption(OD("ssl.PEMKeyPassword", "sslPEMKeyPassword", moe::String,
"password for key in PEM file for SSL" , true));
if (!ret.isOK()) {
return ret;
}
ret = options->addOption(OD("ssl.CRLFile", "sslCRLFile", moe::String,
"Certificate Revocation List file for SSL", true));
if (!ret.isOK()) {
return ret;
}
ret = options->addOption(OD("ssl.FIPSMode", "sslFIPSMode", moe::Switch,
"activate FIPS 140-2 mode at startup", true));
if (!ret.isOK()) {
return ret;
}
#endif
ret = options->addOption(OD("dbaddress", "dbaddress", moe::String, "dbaddress" , false));
if (!ret.isOK()) {
return ret;
}
ret = options->addOption(OD("files", "files", moe::StringVector, "files" , false));
if (!ret.isOK()) {
return ret;
}
// for testing, kill op will also be disabled automatically if the tests starts a mongo program
ret = options->addOption(OD("nokillop", "nokillop", moe::Switch, "nokillop", false));
if (!ret.isOK()) {
return ret;
}
// for testing, will kill op without prompting
ret = options->addOption(OD("autokillop", "autokillop", moe::Switch, "autokillop", false));
if (!ret.isOK()) {
return ret;
}
ret = options->addPositionalOption(POD("dbaddress", moe::String, 1));
if (!ret.isOK()) {
return ret;
}
ret = options->addPositionalOption(POD("files", moe::String, -1));
if (!ret.isOK()) {
return ret;
}
return Status::OK();
}