本文整理汇总了C++中moe::OptionSection类的典型用法代码示例。如果您正苦于以下问题:C++ OptionSection类的具体用法?C++ OptionSection怎么用?C++ OptionSection使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了OptionSection类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: printMongoStatHelp
void printMongoStatHelp(const moe::OptionSection options, std::ostream* out) {
*out << "View live MongoDB performance statistics.\n" << std::endl;
*out << "usage: mongostat [options] [sleep time]" << std::endl;
*out << "sleep time: time to wait (in seconds) between calls" << std::endl;
*out << options.helpString();
*out << "\n";
*out << " Fields\n";
*out << " inserts \t- # of inserts per second (* means replicated op)\n";
*out << " query \t- # of queries per second\n";
*out << " update \t- # of updates per second\n";
*out << " delete \t- # of deletes per second\n";
*out << " getmore \t- # of get mores (cursor batch) per second\n";
*out << " command \t- # of commands per second, on a slave its local|replicated\n";
*out << " flushes \t- # of fsync flushes per second\n";
*out << " mapped \t- amount of data mmaped (total data size) megabytes\n";
*out << " vsize \t- virtual size of process in megabytes\n";
*out << " res \t- resident size of process in megabytes\n";
*out << " faults \t- # of pages faults per sec\n";
*out << " locked \t- name of and percent time for most locked database\n";
*out << " idx miss \t- percent of btree page misses (sampled)\n";
*out << " qr|qw \t- queue lengths for clients waiting (read|write)\n";
*out << " ar|aw \t- active clients (read|write)\n";
*out << " netIn \t- network traffic in - bytes\n";
*out << " netOut \t- network traffic out - bytes\n";
*out << " conn \t- number of open connections\n";
*out << " set \t- replica set name\n";
*out << " repl \t- replication type \n";
*out << " \t PRI - primary (master)\n";
*out << " \t SEC - secondary\n";
*out << " \t REC - recovering\n";
*out << " \t UNK - unknown\n";
*out << " \t SLV - slave\n";
*out << " \t RTR - mongos process (\"router\")\n";
*out << std::flush;
}
示例2: printMongoRestoreHelp
void printMongoRestoreHelp(const moe::OptionSection options, std::ostream* out) {
*out << "Import BSON files into MongoDB.\n" << std::endl;
*out << "usage: mongorestore [options] [directory or filename to restore from]"
<< std::endl;
*out << options.helpString();
*out << std::flush;
}
示例3: printMongoImportHelp
void printMongoImportHelp(const moe::OptionSection options, std::ostream* out) {
*out << "Import CSV, TSV or JSON data into MongoDB.\n" << std::endl;
*out << "When importing JSON documents, each document must be a separate line of the input file.\n";
*out << "\nExample:\n";
*out << " mongoimport --host myhost --db my_cms --collection docs < mydocfile.json\n" << std::endl;
*out << options.helpString();
*out << std::flush;
}
示例4: getMongoShellHelp
std::string getMongoShellHelp(StringData name, const moe::OptionSection& options) {
StringBuilder sb;
sb << "usage: " << name << " [options] [db address] [file names (ending in .js)]\n"
<< "db address can be:\n"
<< " foo foo database on local machine\n"
<< " 192.168.0.5/foo foo database on 192.168.0.5 machine\n"
<< " 192.168.0.5:9999/foo foo database on 192.168.0.5 machine on port 9999\n"
<< options.helpString() << "\n"
<< "file names: a list of files to run. files have to end in .js and will exit after "
<< "unless --shell is specified";
return sb.str();
}
示例5: printMongoFilesHelp
void printMongoFilesHelp(const moe::OptionSection options, std::ostream* out) {
*out << "Browse and modify a GridFS filesystem.\n" << std::endl;
*out << "usage: mongofiles [options] command [gridfs filename]" << std::endl;
*out << "command:" << std::endl;
*out << " one of (list|search|put|get)" << std::endl;
*out << " list - list all files. 'gridfs filename' is an optional prefix " << std::endl;
*out << " which listed filenames must begin with." << std::endl;
*out << " search - search all files. 'gridfs filename' is a substring " << std::endl;
*out << " which listed filenames must contain." << std::endl;
*out << " put - add a file with filename 'gridfs filename'" << std::endl;
*out << " get - get a file with filename 'gridfs filename'" << std::endl;
*out << " delete - delete all files with filename 'gridfs filename'" << std::endl;
*out << options.helpString();
*out << std::flush;
}
示例6: printMongodHelp
void printMongodHelp(const moe::OptionSection& options) {
std::cout << options.helpString() << std::endl;
};
示例7: printMongoExportHelp
void printMongoExportHelp(const moe::OptionSection options, std::ostream* out) {
*out << "Export MongoDB data to CSV, TSV or JSON files.\n" << std::endl;
*out << options.helpString();
*out << std::flush;
}
示例8: getTestFrameworkHelp
std::string getTestFrameworkHelp(const StringData& name, const moe::OptionSection& options) {
StringBuilder sb;
sb << "usage: " << name << " [options] [suite]...\n"
<< options.helpString() << "suite: run the specified test suite(s) only\n";
return sb.str();
}
示例9: addMongoShellOptions
Status addMongoShellOptions(moe::OptionSection* options) {
typedef moe::OptionDescription OD;
typedef moe::PositionalOptionDescription POD;
Status ret = options->addOption(OD("shell", "shell", moe::Switch,
"run the shell after executing files", true));
if (!ret.isOK()) {
return ret;
}
ret = options->addOption(OD("nodb", "nodb", moe::Switch,
"don't connect to mongod on startup - no 'db address' arg expected", true));
if (!ret.isOK()) {
return ret;
}
ret = options->addOption(OD("norc", "norc", moe::Switch,
"will not run the \".mongorc.js\" file on start up", true));
if (!ret.isOK()) {
return ret;
}
ret = options->addOption(OD("quiet", "quiet", moe::Switch, "be less chatty", true));
if (!ret.isOK()) {
return ret;
}
ret = options->addOption(OD("port", "port", moe::String, "port to connect to" , true));
if (!ret.isOK()) {
return ret;
}
ret = options->addOption(OD("host", "host", moe::String, "server to connect to" , true));
if (!ret.isOK()) {
return ret;
}
ret = options->addOption(OD("eval", "eval", moe::String, "evaluate javascript" , true));
if (!ret.isOK()) {
return ret;
}
ret = options->addOption(OD("username", "username,u", moe::String,
"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;
}
//.........这里部分代码省略.........
示例10: printMongoOplogHelp
void printMongoOplogHelp(const moe::OptionSection options, std::ostream* out) {
*out << "Pull and replay a remote MongoDB oplog.\n" << std::endl;
*out << options.helpString();
*out << std::flush;
}
示例11: printBSONDumpHelp
void printBSONDumpHelp(const moe::OptionSection options, std::ostream* out) {
*out << "Display BSON objects in a data file.\n" << std::endl;
*out << "usage: bsondump [options] <bson filename>" << std::endl;
*out << options.helpString();
*out << std::flush;
}