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"); }
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); }
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); }
void CopyCommandLine::InitOptions(Options& opts) { // clang-format off Base::InitOptions(opts); opts.add_options("Copy") ("t,stdin-input", "Use stdin as input") ("resume", "Attempt to resume operation if the destination file exists") ("check-integrity", "Check file integrity") ("r,recursive", "Copy files recursively") ("max-transfers", "Max transfers in parallel", cxxopts::value<uint32_t>()->default_value("1")) ("args", "", cxxopts::value<std::vector<std::string>>()); opts.parse_positional("args"); opts.positional_help("[host@]source_path [[host@]destination_path]"); // clang-format on }