本文整理汇总了C++中boost::program_options::options_description::add_options方法的典型用法代码示例。如果您正苦于以下问题:C++ options_description::add_options方法的具体用法?C++ options_description::add_options怎么用?C++ options_description::add_options使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类boost::program_options::options_description
的用法示例。
在下文中一共展示了options_description::add_options方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InitParameters
void DaemonCommand::InitParameters(boost::program_options::options_description& visibleDesc,
boost::program_options::options_description& hiddenDesc) const
{
visibleDesc.add_options()
("config,c", po::value<std::vector<std::string> >(), "parse a configuration file")
("no-config,z", "start without a configuration file")
("validate,C", "exit after validating the configuration")
("errorlog,e", po::value<std::string>(), "log fatal errors to the specified log file (only works in combination with --daemonize)")
#ifndef _WIN32
("daemonize,d", "detach from the controlling terminal")
#endif /* _WIN32 */
;
#ifndef _WIN32
hiddenDesc.add_options()
("reload-internal", po::value<int>(), "used internally to implement config reload: do not call manually, send SIGHUP instead");
#endif /* _WIN32 */
}
示例2: 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);
}
示例3: twitter_add_options
void twitter_add_options(po::options_description & desc){
desc.add_options()
("twitter_auth", po::value<std::string>(),
"twitter username:password")
("twitter_location", po::value<std::string>(),
"a twitter location spec, as a bounding box or boxes")
("twitter_extra", po::value<std::string>(),
"any extra arguments for the Twitter streaming search");
}
示例4: addGeneric
void addGeneric(po::options_description& o) {
o.add_options()
("blocks", po::value<string>(&blocks_spec), "Block sizes (MATLAB style range)")
("steps", po::value<uint>(&nsteps)->default_value(25), "Max number of blocks for auto-ranging")
("reps", po::value<uint>(&nreps)->default_value(20), "Number of replicates for bootstrap")
("local", po::value<bool>(&local_average)->default_value(true), "Use local avg in block PCA rather than global")
("gold", po::value<string>(&gold_standard_trajectory_name)->default_value(""), "Use this trajectory for the gold-standard instead");
}
示例5: attach_option
void attach_option(const std::string& option,
T* ret_cont,
const std::string& description) {
namespace boost_po = boost::program_options;
assert(ret_cont != NULL);
desc.add_options()
(option.c_str(),
boost_po::value<T>(ret_cont),
description.c_str());
}
示例6: 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);
}
示例7: do_add_visible_options_to_description
/// \brief Add this block's options to the provided options_description
void cath_assign_domains_options_block::do_add_visible_options_to_description(po::options_description &arg_desc ///< The options_description to which the options are added
) {
const string default_forbidden_nodes_str = join( DEFAULT_FORBIDDEN_NODES, ", " );
arg_desc.add_options()
( PO_SVMLIGHT_RBF_FILE.c_str(), po::value<path >( &rbf_svm_file ), "File containing SVM-light RBF model for CATH assignment" )
( PO_FILELIST_FILE.c_str(), po::value<path >( &data_data_file ), "File of data files (one line per query domain containing: ssap_results_file prc_results_file)" )
( PO_SF_OF_DOMAIN_FILE.c_str(), po::value<path >( &sf_of_dom_file ), "File containing up-to-date assignments (one line per domain containing: domain_id superfamily_id)" )
( PO_FORBIDDEN_NODES.c_str(), po::value<str_vec>( &forbidden_nodes )->default_value( DEFAULT_FORBIDDEN_NODES, default_forbidden_nodes_str ), "List of nodes to which automatic assignment is forbidden; specify option multiple times for multiple nodes\nRECOMMENDED: do not specify this option so that the default list of propeller architectures is used." )
;
}
示例8: desc
command_line_options_parser() : desc("command-line-options") {
desc.add_options()
("help,h", "Display this message of command line options and exit")
("version", "Display the application version and exit")
("verbose,v",
"Include more details of builds and status. By default a count of builds in each 'state' is printed to the console. "
"Verbose output prints the status of each build and the causes of any failures.")
("threshold", boost::program_options::value<int>()->default_value(6), "Threshold for duplicate discovery (default is 6)")
("input-files", boost::program_options::value<vector<string>>(), "paths to scan for duplicates.");
}
示例9: InitParameters
void BlackAndWhitelistCommand::InitParameters(boost::program_options::options_description& visibleDesc,
boost::program_options::options_description& hiddenDesc) const
{
if (m_Command == BlackAndWhitelistCommandAdd || m_Command == BlackAndWhitelistCommandRemove) {
visibleDesc.add_options()
("zone", po::value<std::string>(), "The name of the zone")
("host", po::value<std::string>(), "The name of the host")
("service", po::value<std::string>(), "The name of the service");
}
}
示例10: InitParameters
void PKISaveCertCommand::InitParameters(boost::program_options::options_description& visibleDesc,
boost::program_options::options_description& hiddenDesc) const
{
visibleDesc.add_options()
("key", po::value<std::string>(), "Key file path (input), obsolete")
("cert", po::value<std::string>(), "Certificate file path (input), obsolete")
("trustedcert", po::value<std::string>(), "Trusted certificate file path (output)")
("host", po::value<std::string>(), "Icinga 2 host")
("port", po::value<std::string>()->default_value("5665"), "Icinga 2 port");
}
示例11: addOptions
void DescribeCommand::addOptions(po::options_description &options, po::options_description &hidden_options)
{
m_target.addOptions(options, hidden_options);
options.add_options()
("set-manufacturer,m", po::value<string>(&m_manufacturer), "set manufacturer string")
("set-product,p", po::value<string>(&m_product), "set product string")
("set-vendor-id", po::value<HexOption<uint16_t>>(&m_vendor_id), "set vendor ID")
("set-product-id", po::value<HexOption<uint16_t>>(&m_product_id), "set product ID")
;
}
示例12:
WolfwizardOptionStruct()
:fopt("Options")
{
fopt.add_options()
( "version,v", "print version" )
( "help,h", "print help message" )
( "config", po::value<std::string>(), "specify configuration file to load" )
;
popt.add( "cmd", 1);
}
示例13: InitParameters
void TroubleshootCommand::InitParameters(boost::program_options::options_description& visibleDesc,
boost::program_options::options_description& hiddenDesc) const
{
visibleDesc.add_options()
("console,c", "print to console instead of file")
("output,o", boost::program_options::value<std::string>(), "path to output file")
("include-objects", "Print the whole objectfile (like `object list`)")
("include-vars", "Print all Variables (like `variable list`)")
;
}
示例14: addGeneric
void addGeneric(po::options_description& o) {
o.add_options()
("skip,k", po::value<uint>(&skip)->default_value(0), "Number of frames to skip")
("stderr", po::value<bool>(&use_stderr)->default_value(false), "Report stderr rather than stddev")
("blow", po::value<double>(&length_low)->default_value(1.5), "Low cutoff for bond length")
("bhi", po::value<double>(&length_high)->default_value(3.0), "High cutoff for bond length")
("angle", po::value<double>(&max_angle)->default_value(30.0), "Max bond angle deviation from linear")
("periodic", po::value<bool>(&use_periodicity)->default_value(false), "Use periodic boundary")
("name,N", po::value< vector<string> >(&acceptor_names), "Name of an acceptor selection (required)")
("acceptor,S", po::value< vector<string> >(&acceptor_selections), "Acceptor selection (required)");
}
示例15: setProgramOptions
void MeshData::setProgramOptions(boost::program_options::options_description &option_desc,
boost::program_options::positional_options_description &option_pos)
{
option_desc.add_options()
("block,b", po::value<std::string>(&blockName),"name of the data block to read from the SDF file")
("input,i", po::value<std::string>(&inputName),"name of the SDF file")
("cfd,d", "read data from old CFD files instead of SDF files");
option_pos.add("block", 1);
option_pos.add("input", 2);
}