本文整理汇总了C++中boost::program_options::options_description类的典型用法代码示例。如果您正苦于以下问题:C++ options_description类的具体用法?C++ options_description怎么用?C++ options_description使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了options_description类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: plugin_set_program_options
void delayed_node_plugin::plugin_set_program_options(bpo::options_description& cli, bpo::options_description& cfg)
{
cli.add_options()
("trusted-node", boost::program_options::value<std::string>(), "RPC endpoint of a trusted validating node (required)")
;
cfg.add(cli);
}
示例2: set_program_options
void application::set_program_options(boost::program_options::options_description& command_line_options,
boost::program_options::options_description& configuration_file_options) const
{
configuration_file_options.add_options()
("p2p-endpoint", bpo::value<string>(), "Endpoint for P2P node to listen on")
("seed-node,s", bpo::value<vector<string>>()->composing(), "P2P nodes to connect to on startup (may specify multiple times)")
("rpc-endpoint", bpo::value<string>()->implicit_value("127.0.0.1:8090"), "Endpoint for websocket RPC to listen on")
("rpc-tls-endpoint", bpo::value<string>()->implicit_value("127.0.0.1:8089"), "Endpoint for TLS websocket RPC to listen on")
("server-pem,p", bpo::value<string>()->implicit_value("server.pem"), "The TLS certificate file for this server")
("server-pem-password,P", bpo::value<string>()->implicit_value(""), "Password for this certificate")
("genesis-json", bpo::value<boost::filesystem::path>(), "File to read Genesis State from")
("apiaccess", bpo::value<boost::filesystem::path>(), "JSON file specifying API permissions")
;
command_line_options.add(configuration_file_options);
command_line_options.add_options()
("create-genesis-json", bpo::value<boost::filesystem::path>(),
"Path to create a Genesis State at. If a well-formed JSON file exists at the path, it will be parsed and any "
"missing fields in a Genesis State will be added, and any unknown fields will be removed. If no file or an "
"invalid file is found, it will be replaced with an example Genesis State.")
("replay-blockchain", "Rebuild object graph by replaying all blocks")
("resync-blockchain", "Delete all blocks and re-sync with network from scratch")
;
command_line_options.add(_cli_options);
configuration_file_options.add(_cfg_options);
}
示例3: fst
inline void initRules2WeightsOptions (po::options_description& desc
, bool addAllOptions=true) {
using namespace HifstConstants;
if (addAllOptions) {
desc.add_options()
( kRangeExtended.c_str(),
po::value<std::string>()->default_value ("1"),
"Indices of sentences to process" )
// Not supported. Very low priority, it's super fast as it is.
// ( kNThreads.c_str(), po::value<unsigned>(),
// "Number of threads (trimmed to number of cpus in the machine) " )
// Not supported yet
// ( kRulesToWeightsLatticeFilterbyAlilats.c_str(),
// "Filter the flower lattice with the vocabulary of the alignment lattices" )
( kRulesToWeightsLoadGrammar.c_str(), po::value<std::string>(),
"Load a synchronous context-free grammar file" )
( kRulesToWeightsLoadalilats.c_str() ,
po::value<std::string>(), "Load hifst sparse weight translation lattice" )
( kRulesToWeightsNumberOfLanguageModels.c_str()
, po::value<unsigned>()->default_value ( 1 )
, "Number of language models" )
;
}
desc.add_options()
( kRulesToWeightsLatticeStore.c_str() ,
po::value<std::string>()->default_value ( "" ),
"Store the fst (tropical tuple sparse weight) containing a vector of features per arc " )
;
}
示例4: addGlobalOptions
void CmdLine::addGlobalOptions( boost::program_options::options_description& general ,
boost::program_options::options_description& hidden ){
/* support for -vv -vvvv etc. */
for (string s = "vv"; s.length() <= 12; s.append("v")) {
hidden.add_options()(s.c_str(), "verbose");
}
general.add_options()
("help,h", "show this usage information")
("version", "show version information")
("config,f", po::value<string>(), "configuration file specifying additional options")
("verbose,v", "be more verbose (include multiple times for more verbosity e.g. -vvvvv)")
("quiet", "quieter output")
("port", po::value<int>(&cmdLine.port), "specify port number")
("bind_ip", po::value<string>(&cmdLine.bind_ip), "comma separated list of ip addresses to listen on - all local ips by default")
("logpath", po::value<string>() , "log file to send write to instead of stdout - has to be a file, not directory" )
("logappend" , "append to logpath instead of over-writing" )
("pidfilepath", po::value<string>(), "full path to pidfile (if not set, no pidfile is created)")
("keyFile", po::value<string>(), "private key for cluster authentication (only for replica sets)")
#ifndef _WIN32
("fork" , "fork server process" )
#endif
;
}
示例5: plugin_set_program_options
void BackendPlugin::plugin_set_program_options(boost::program_options::options_description& command_line_options,
boost::program_options::options_description& config_file_options) {
namespace bpo = boost::program_options;
command_line_options.add_options()("port,p", bpo::value<uint16_t>()->default_value(17073),
"The port for the server to listen on");
config_file_options.add_options()("port,p", bpo::value<uint16_t>()->default_value(17073),
"The port for the server to listen on");
}
示例6: plugin_set_program_options
void monitor_plugin::plugin_set_program_options(
boost::program_options::options_description& command_line_options,
boost::program_options::options_description& config_file_options)
{
command_line_options.add_options()
(MONITOR_OPT_ACTION_TYPE, boost::program_options::value<uint32_t>(), "The type of operation monitored")
;
config_file_options.add(command_line_options);
}
示例7: plugin_set_program_options
void account_history_plugin::plugin_set_program_options(
boost::program_options::options_description& cli,
boost::program_options::options_description& cfg
)
{
cli.add_options()
("track-account", boost::program_options::value<std::vector<std::string>>()->composing()->multitoken(), "Account ID to track history for (may specify multiple times)")
;
cfg.add(cli);
}
示例8: plugin_set_program_options
void account_history_plugin::plugin_set_program_options(
boost::program_options::options_description& cli,
boost::program_options::options_description& cfg
)
{
cli.add_options()
("track-account-range", boost::program_options::value<std::vector<std::string>>()->composing()->multitoken(), "Defines a range of accounts to track as a json pair [\"from\",\"to\"] [from,to]")
("filter-posting-ops", "Ignore posting operations, only track transfers and account updates")
;
cfg.add(cli);
}
示例9: plugin_set_program_options
void snapshot_plugin::plugin_set_program_options(
boost::program_options::options_description& command_line_options,
boost::program_options::options_description& config_file_options)
{
command_line_options.add_options()
(OPT_BLOCK_NUM, bpo::value<uint32_t>(), "Block number after which to do a snapshot")
(OPT_BLOCK_TIME, bpo::value<string>(), "Block time (ISO format) after which to do a snapshot")
(OPT_DEST, bpo::value<string>(), "Pathname of JSON file where to store the snapshot")
;
config_file_options.add(command_line_options);
}
示例10: addOptions
void SetCommand::addOptions(po::options_description &options, po::options_description &hidden_options)
{
m_target.addOptions(options, hidden_options);
options.add_options()
("pin", po::value<int>(&m_pin), "pin index (starting from 0)")
("value", po::value<bool>(&m_value), "pin value")
("mask", po::value<BitMap<uint8_t>>(&m_mask), "pin mask")
;
hidden_options.add_options()
("values", po::value<BitMap<uint8_t>>(&m_values), "")
;
}
示例11: addGlobalOptions
void CmdLine::addGlobalOptions( boost::program_options::options_description& general ,
boost::program_options::options_description& hidden ,
boost::program_options::options_description& ssl_options ) {
/* support for -vv -vvvv etc. */
for (string s = "vv"; s.length() <= 12; s.append("v")) {
hidden.add_options()(s.c_str(), "verbose");
}
StringBuilder portInfoBuilder;
StringBuilder maxConnInfoBuilder;
portInfoBuilder << "specify port number - " << DefaultDBPort << " by default";
maxConnInfoBuilder << "max number of simultaneous connections - " << DEFAULT_MAX_CONN << " by default";
general.add_options()
("help,h", "show this usage information")
("version", "show version information")
("config,f", po::value<string>(), "configuration file specifying additional options")
("verbose,v", "be more verbose (include multiple times for more verbosity e.g. -vvvvv)")
("quiet", "quieter output")
("port", po::value<int>(&cmdLine.port), portInfoBuilder.str().c_str())
("bind_ip", po::value<string>(&cmdLine.bind_ip), "comma separated list of ip addresses to listen on - all local ips by default")
("maxConns",po::value<int>(), maxConnInfoBuilder.str().c_str())
("objcheck", "inspect client data for validity on receipt")
("logpath", po::value<string>() , "log file to send write to instead of stdout - has to be a file, not directory" )
("logappend" , "append to logpath instead of over-writing" )
("pidfilepath", po::value<string>(), "full path to pidfile (if not set, no pidfile is created)")
("keyFile", po::value<string>(), "private key for cluster authentication")
("enableFaultInjection", "enable the fault injection framework, for debugging."
" DO NOT USE IN PRODUCTION")
#ifndef _WIN32
("nounixsocket", "disable listening on unix sockets")
("unixSocketPrefix", po::value<string>(), "alternative directory for UNIX domain sockets (defaults to /tmp)")
("fork" , "fork server process" )
("syslog" , "log to system's syslog facility instead of file or stdout" )
#endif
;
#ifdef MONGO_SSL
ssl_options.add_options()
("sslOnNormalPorts" , "use ssl on configured ports" )
("sslPEMKeyFile" , po::value<string>(&cmdLine.sslPEMKeyFile), "PEM file for ssl" )
("sslPEMKeyPassword" , new PasswordValue(&cmdLine.sslPEMKeyPassword) , "PEM file password" )
#endif
;
// Extra hidden options
hidden.add_options()
("traceExceptions", "log stack traces for every exception");
}
示例12: plugin_set_program_options
void elasticsearch_plugin::plugin_set_program_options(
boost::program_options::options_description& cli,
boost::program_options::options_description& cfg
)
{
cli.add_options()
("elasticsearch-node-url", boost::program_options::value<std::string>(), "Elastic Search database node url")
("elasticsearch-bulk-replay", boost::program_options::value<uint32_t>(), "Number of bulk documents to index on replay(5000)")
("elasticsearch-bulk-sync", boost::program_options::value<uint32_t>(), "Number of bulk documents to index on a syncronied chain(10)")
("elasticsearch-logs", boost::program_options::value<bool>(), "Log bulk events to database")
("elasticsearch-visitor", boost::program_options::value<bool>(), "Use visitor to index additional data(slows down the replay)")
;
cfg.add(cli);
}
示例13: plugin_set_program_options
void witness_plugin::plugin_set_program_options(
boost::program_options::options_description& command_line_options,
boost::program_options::options_description& config_file_options)
{
command_line_options.add_options()
("enable-stale-production", bpo::bool_switch()->notifier([this](bool e){_production_enabled = e;}), "Enable block production, even if the chain is stale")
("witness-id,w", bpo::value<vector<string>>()->composing()->multitoken(),
"ID of witness controlled by this node (e.g. \"1.7.0\", quotes are required, may specify multiple times)")
("private-key", bpo::value<vector<string>>()->composing()->multitoken()->
DEFAULT_VALUE_VECTOR(std::make_pair(chain::key_id_type(), fc::ecc::private_key::regenerate(fc::sha256::hash(std::string("genesis"))))),
"Tuple of [key ID, private key] (may specify multiple times)")
;
config_file_options.add(command_line_options);
}
示例14: addWindowsOptions
void CmdLine::addWindowsOptions( boost::program_options::options_description& windows ,
boost::program_options::options_description& hidden ){
windows.add_options()
("install", "install mongodb service")
("remove", "remove mongodb service")
("reinstall", "reinstall mongodb service (equivilant of mongod --remove followed by mongod --install)")
("serviceName", po::value<string>(), "windows service name")
("serviceDisplayName", po::value<string>(), "windows service display name")
("serviceDescription", po::value<string>(), "windows service description")
("serviceUser", po::value<string>(), "user name service executes as")
("servicePassword", po::value<string>(), "password used to authenticate serviceUser")
;
hidden.add_options()("service", "start mongodb service");
}
示例15: process
void process(boost::program_options::options_description &desc, client::destination_container &source, client::destination_container &data) {
desc.add_options()
("path", po::value<std::string>()->notifier(boost::bind(&client::destination_container::set_string_data, data, "path", _1)),
"")
;
}