当前位置: 首页>>代码示例>>C++>>正文


C++ Options::add_options方法代码示例

本文整理汇总了C++中Options::add_options方法的典型用法代码示例。如果您正苦于以下问题:C++ Options::add_options方法的具体用法?C++ Options::add_options怎么用?C++ Options::add_options使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Options的用法示例。


在下文中一共展示了Options::add_options方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: InitOptions

void StandardCommandLine::InitOptions(Options& opts) {
  Base::InitOptions(opts);

  if (IsServerCli()) {
    // server cli
    opts.add_options()
      ("R,relay-only", "The server will only relay connections")
      ("l,bind-address", "Server bind address", cxxopts::value<std::string>());
  } else {
    // client cli
    opts.add_options()
      ("m,max-connect-attempts",
       "Max unsuccessful connection attempts before stopping",
       cxxopts::value<uint32_t>()->default_value("1"))
      ("t,reconnect-delay",
       "Time to wait before attempting to reconnect",
        cxxopts::value<uint32_t>()->default_value("60"))
      ("n,no-reconnect",
       "Do not attempt to reconnect after loosing a connection")
      ("server-address", "", cxxopts::value<std::vector<std::string>>());

    opts.parse_positional("server-address");

    opts.positional_help("server_address");
  }

  opts.add_options()
    ("g,gateway-ports", "Enable gateway ports")
    ("S,status", "Display microservices status");
}
开发者ID:securesocketfunneling,项目名称:ssf,代码行数:30,代码来源:command_line.cpp

示例2: SetOptions

void MyApp::SetOptions(Options& o, Options& h, Positional& p)
{
    namespace po = boost::program_options;

    o.add_options()
        ("all,a", po::bool_switch(&m_checkStores)->default_value(false), "Run a thorough check")
        ("show",  po::bool_switch(&m_show)->default_value(false),        "Render and show images, used with -a");

    h.add_options()
        ("in",    po::value<String>(&m_seqPath)->default_value(""), "Path to the input sequence database folder");

    p.add("in", 1);
}
开发者ID:johnnychien85,项目名称:seq2map,代码行数:13,代码来源:chkseq.cpp

示例3: parseArgs

void parseArgs(int argc, char* argv[], Options& options) {
    options.add_options()
        (K_OPT        "," L_K_OPT       , "K parameter"                      , value<int>())
        (LINK_CAP_OPT "," L_LINK_CAP_OPT, "Link Capacity (in MB)"            , value<int>())
        (HOST_CAP_OPT "," L_HOST_CAP_OPT, "Host Capacity (in Number of CPUs)", value<int>())
        (OUTPUT_OPT   "," L_OUTPUT_OPT  , "Output File (Default is dc.txt)"  , value<string>());
    options.parse(argc, argv);
}
开发者ID:miladghaznavi,项目名称:Elastic-VNF-Placement,代码行数:8,代码来源:main.cpp


注:本文中的Options::add_options方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。