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);
}
Example #2
0
    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
            ;
        
    }
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 " )
      ;
}
Example #4
0
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);
}
Example #5
0
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);
}
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");
}
Example #7
0
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);
}
Example #8
0
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);
}
Example #9
0
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);
}
Example #10
0
	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), "")
		;
	}
Example #11
0
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");
}
Example #12
0
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);
}
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);
}
Example #14
0
 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");
 }
Example #15
0
// Private methods ----------------------------------
void
EnvironmentOptions::defineMyOptions(boost::program_options::options_description& optionsDesc) const
{
  queso_deprecated();

#ifdef QUESO_MEMORY_DEBUGGING
  std::cout << "In EnvOptions::defineMyOptions(), before add_options()" << std::endl;
#endif
  optionsDesc.add_options()
    (m_option_help.c_str(),                                                                                                 "produce help message for  environment"       )
    (m_option_numSubEnvironments.c_str(),    boost::program_options::value<unsigned int>()->default_value(UQ_ENV_NUM_SUB_ENVIRONMENTS_ODV),     "number of subEnvironments"                     )
    (m_option_subDisplayFileName.c_str(),    boost::program_options::value<std::string >()->default_value(UQ_ENV_SUB_DISPLAY_FILE_NAME_ODV),    "output filename for subscreen writing"         )
    (m_option_subDisplayAllowAll.c_str(),    boost::program_options::value<bool        >()->default_value(UQ_ENV_SUB_DISPLAY_ALLOW_ALL_ODV),    "Allow all processors to write to output file"  )
    (m_option_subDisplayAllowInter0.c_str(), boost::program_options::value<bool        >()->default_value(UQ_ENV_SUB_DISPLAY_ALLOW_INTER0_ODV), "Allow all inter0 nodes to write to output file")
    (m_option_subDisplayAllowedSet.c_str(),  boost::program_options::value<std::string >()->default_value(UQ_ENV_SUB_DISPLAY_ALLOWED_SET_ODV),  "subEnvs that will write to output file"        )
    (m_option_displayVerbosity.c_str(),      boost::program_options::value<unsigned int>()->default_value(UQ_ENV_DISPLAY_VERBOSITY_ODV),        "set verbosity"                                 )
    (m_option_syncVerbosity.c_str(),         boost::program_options::value<unsigned int>()->default_value(UQ_ENV_SYNC_VERBOSITY_ODV),           "set sync verbosity"                            )
    (m_option_checkingLevel.c_str(),         boost::program_options::value<unsigned int>()->default_value(UQ_ENV_CHECKING_LEVEL_ODV),           "set checking level"                            )
    (m_option_rngType.c_str(),               boost::program_options::value<std::string >()->default_value(UQ_ENV_RNG_TYPE_ODV),                 "set rngType"                                   )
    (m_option_seed.c_str(),                  boost::program_options::value<int         >()->default_value(UQ_ENV_SEED_ODV),                     "set seed"                                      )
    (m_option_platformName.c_str(),          boost::program_options::value<std::string >()->default_value(UQ_ENV_PLATFORM_NAME_ODV),            "platform name"                                 )
    (m_option_identifyingString.c_str(),     boost::program_options::value<std::string >()->default_value(UQ_ENV_IDENTIFYING_STRING_ODV),       "identifying string"                            )
  //(m_option_numDebugParams.c_str(),        boost::program_options::value<unsigned int>()->default_value(UQ_ENV_NUM_DEBUG_PARAMS_ODV),         "set number of debug parameters"                )
  ;
#ifdef QUESO_MEMORY_DEBUGGING
  std::cout << "In EnvOptions::defineMyOptions(), after add_options()" << std::endl;
#endif

  return;
}
Example #16
0
void get_options( po::options_description& desc )
{
    desc.add_options( )
        ("help,?",   "help message")
        ("server,s", po::value<std::string>( ),
                     "server name; <tcp address>:<port> or <pipe/file name>")

        ( "stat,I",                             "get db status")
        ( "events,e",                           "subscribe and show events")

        ( "exist,E", po::value<std::string>( ), "checks if record exist")
        ( "set,S",   po::value<std::string>( ), "set value; "
                                            "use --value options for values")
        ( "del,D",   po::value<std::string>( ), "delete value")

        ( "upd,U",   po::value<std::string>( ), "update value if it exist; "
                                            "use --value options for values")
        ( "get,G",   po::value<std::string>( ), "get value")

        ( "value,V", po::value<std::vector< std::string> >( ),  "values for "
                                                      " set or upd commands;"
                           " -V \"value1\", -V \"value2\", -V \"value3\" ...")

        ;
}
Example #17
0
void PKITicketCommand::InitParameters(boost::program_options::options_description& visibleDesc,
	boost::program_options::options_description& hiddenDesc) const
{
	visibleDesc.add_options()
		("cn", po::value<std::string>(), "Certificate common name")
		("salt", po::value<std::string>(), "Ticket salt");
}
Example #18
0
		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)),
					"")

				;
		}
Example #19
0
  void
  Engine::getCommonOptions(boost::program_options::options_description& opts)
  {
    boost::program_options::options_description simopts("Common Engine Options");

    simopts.add_options()
      ("events,c", boost::program_options::value<size_t>()
       ->default_value(std::numeric_limits<size_t>::max(), "no-limit"),
       "No. of events to run the simulation for.")
      ("print-events,p", boost::program_options::value<size_t>()->default_value(100000), 
       "No. of events between periodic screen output.")
      ("random-seed,s", boost::program_options::value<unsigned int>(),
       "Random seed for generator (To make the simulation reproduceable - Only for debugging!)")
      ("ticker-period,t",boost::program_options::value<double>(), 
       "Time between data collections. Defaults to the system MFT or 1 if no MFT available")
      ("equilibrate,E", "Turns off most output for a fast silent run")
      ("load-plugin,L", boost::program_options::value<std::vector<std::string> >(), 
       "Additional individual plugins to load")
      ("sim-end-time,f", boost::program_options::value<double>()->default_value(std::numeric_limits<double>::max(), "no limit"), 
       "Simulation end time (Note, In replica exchange, each systems end time is scaled by"
       "(T_cold/T_i)^{1/2}, see replex-interval)")
      ("unwrapped", "Don't apply the boundary conditions of the system when writing out the particle positions.")
      ("snapshot", boost::program_options::value<double>(),
       "Sets the system time inbetween saving snapshots of the system.")
      ;
  
    opts.add(simopts);
  }
Example #20
0
void producer_plugin::set_program_options(
   boost::program_options::options_description& command_line_options,
   boost::program_options::options_description& config_file_options)
{
   auto default_priv_key = private_key_type::regenerate<fc::ecc::private_key_shim>(fc::sha256::hash(std::string("nathan")));
   auto private_key_default = std::make_pair(default_priv_key.get_public_key(), default_priv_key );

   boost::program_options::options_description producer_options;

   producer_options.add_options()
         ("enable-stale-production,e", boost::program_options::bool_switch()->notifier([this](bool e){my->_production_enabled = e;}), "Enable block production, even if the chain is stale.")
         ("required-participation", boost::program_options::value<uint32_t>()
                                       ->default_value(uint32_t(config::required_producer_participation/config::percent_1))
                                       ->notifier([this](uint32_t e) {
                                          my->_required_producer_participation = std::min(e, 100u) * config::percent_1;
                                       }),
                                       "Percent of producers (0-100) that must be participating in order to produce blocks")
         ("producer-name,p", boost::program_options::value<vector<string>>()->composing()->multitoken(),
          "ID of producer controlled by this node (e.g. inita; may specify multiple times)")
         ("private-key", boost::program_options::value<vector<string>>()->composing()->multitoken()->default_value({fc::json::to_string(private_key_default)},
                                                                                                fc::json::to_string(private_key_default)),
          "Tuple of [public key, WIF private key] (may specify multiple times)")
         ;
   config_file_options.add(producer_options);
}
Example #21
0
int main(int argc, char **argv) {
  try {
    desc.add_options()
    ("help,h",
     "Print messages about any errors encountered in parsing the pdb file.")
        ("input-file,i", po::value< std::string >(&input),
         "input pdb file");
    po::positional_options_description p;
    p.add("input-file", 1);
    po::variables_map vm;
    po::store(
              po::command_line_parser(argc,
                                      argv).options(desc).positional(p).run(),
              vm);
    po::notify(vm);
    if (vm.count("help") || input.empty()) {
      print_help();
      return 1;
    }
    IMP_NEW(IMP::Model, m, ());
    m->set_log_level(IMP::SILENT);
    IMP::set_log_level(IMP::VERBOSE);
    IMP::atom::Hierarchies inhs;
    IMP_CATCH_AND_TERMINATE(inhs= IMP::atom::read_multimodel_pdb(input, m));
    for (unsigned int i=0; i< inhs.size(); ++i) {
      IMP::atom::add_bonds(inhs[i]);
    }
    return 0;
  } catch (const IMP::Exception &e) {
    std::cerr << "Error: " << e.what() << std::endl;
    return 1;
  } catch (const std::exception &e) {
    std::cerr << "Error: " << e.what() << std::endl;
  }
}
Example #22
0
void addGFlag<bool>(
    gflags::CommandLineFlagInfo&& flag,
    po::options_description& desc,
    ProgramOptionsStyle style) {
  auto gflagInfo = std::make_shared<GFlagInfo<bool>>(std::move(flag));
  auto& info = gflagInfo->info();
  auto name = getName(info.name);
  std::string negationPrefix;

  switch (style) {
    case ProgramOptionsStyle::GFLAGS:
      negationPrefix = "no";
      break;
    case ProgramOptionsStyle::GNU:
      std::replace(name.begin(), name.end(), '_', '-');
      negationPrefix = "no-";
      break;
  }

  // clang-format off
  desc.add_options()
    (name.c_str(),
     new BoolGFlagValueSemantic(gflagInfo),
     info.description.c_str())
    ((negationPrefix + name).c_str(),
     new NegativeBoolGFlagValueSemantic(gflagInfo),
     folly::to<std::string>("(no) ", info.description).c_str());
  // clang-format on
}
Example #23
0
void ConsoleCommand::InitParameters(boost::program_options::options_description& visibleDesc,
    boost::program_options::options_description& hiddenDesc) const
{
	visibleDesc.add_options()
		("connect,c", po::value<std::string>(), "connect to an Icinga 2 instance")
	;
}
Example #24
0
void
GpmsaComputerModelOptions::defineMyOptions(boost::program_options::options_description& optionsDesc) const
{
  queso_deprecated();

  optionsDesc.add_options()
    (m_option_help.c_str(),                                                                                                                        "produce help message for mixed inverse problem")
    (m_option_checkAgainstPreviousSample.c_str(),      boost::program_options::value<bool        >()->default_value(UQ_GCM_CHECK_AGAINST_PREVIOUS_SAMPLE_ODV        ), "check against previous sample"                 )
    (m_option_dataOutputFileName.c_str(),              boost::program_options::value<std::string >()->default_value(UQ_GCM_DATA_OUTPUT_FILE_NAME_ODV                ), "name of data output file"                      )
    (m_option_dataOutputAllowAll.c_str(),              boost::program_options::value<bool        >()->default_value(UQ_GCM_DATA_OUTPUT_ALLOW_ALL_ODV                ), "allow all or not"                              )
    (m_option_dataOutputAllowedSet.c_str(),            boost::program_options::value<std::string >()->default_value(UQ_GCM_DATA_OUTPUT_ALLOWED_SET_ODV              ), "subEnvs that will write to data output file"   )
    (m_option_priorSeqNumSamples.c_str(),              boost::program_options::value<unsigned int>()->default_value(UQ_GCM_PRIOR_SEQ_NUM_SAMPLES_ODV                ), "prior sequence size"                           )
    (m_option_priorSeqDataOutputFileName.c_str(),      boost::program_options::value<std::string >()->default_value(UQ_GCM_PRIOR_SEQ_DATA_OUTPUT_FILE_NAME_ODV      ), "prior sequence data output filename"           )
    (m_option_priorSeqDataOutputFileType.c_str(),      boost::program_options::value<std::string >()->default_value(UQ_GCM_PRIOR_SEQ_DATA_OUTPUT_FILE_TYPE_ODV      ), "prior sequence data output filetype"           )
    (m_option_priorSeqDataOutputAllowAll.c_str(),      boost::program_options::value<bool        >()->default_value(UQ_GCM_PRIOR_SEQ_DATA_OUTPUT_ALLOW_ALL_ODV      ), "allow all or not"                              )
    (m_option_priorSeqDataOutputAllowedSet.c_str(),    boost::program_options::value<std::string >()->default_value(UQ_GCM_PRIOR_SEQ_DATA_OUTPUT_ALLOWED_SET_ODV    ), "subEnvs that will write to data output file"   )
    (m_option_nuggetValueForBtWyB.c_str(),             boost::program_options::value<double      >()->default_value(UQ_GCM_NUGGET_VALUE_FOR_BT_WY_B_ODV             ), "nugget value for Bt_Wy_W matrix"               )
    (m_option_nuggetValueForBtWyBInv.c_str(),          boost::program_options::value<double      >()->default_value(UQ_GCM_NUGGET_VALUE_FOR_BT_WY_B_INV_ODV         ), "nugget value for Bt_Wy_W inverse matrix"       )
    (m_option_formCMatrix.c_str(),                     boost::program_options::value<double      >()->default_value(UQ_GCM_FORM_C_MATRIX_ODV                        ), "form C matrix"                                 )
    (m_option_useTildeLogicForRankDefficientC.c_str(), boost::program_options::value<bool        >()->default_value(UQ_GCM_USE_TILDE_LOGIC_FOR_RANK_DEFFICIENT_C_ODV), "use tilde logic for rank defficient C"         )
    (m_option_predLag.c_str(),                         boost::program_options::value<unsigned int>()->default_value(UQ_GCM_PRED_LAG_ODV                             ), "predLag"                                       )
    (m_option_predVUsBySamplingRVs.c_str(),            boost::program_options::value<bool        >()->default_value(UQ_GCM_PRED_VUS_BY_SAMPLING_RVS_ODV             ), "predVUsBySamplingRVs"                          )
    (m_option_predVUsBySummingRVs.c_str(),             boost::program_options::value<bool        >()->default_value(UQ_GCM_PRED_VUS_BY_SUMMING_RVS_ODV              ), "predVUsBySummingRVs"                           )
    (m_option_predVUsAtKeyPoints.c_str(),              boost::program_options::value<bool        >()->default_value(UQ_GCM_PRED_VUS_AT_KEY_POINTS_ODV               ), "predVUsAtKeyPoints"                            )
    (m_option_predWsBySamplingRVs.c_str(),             boost::program_options::value<bool        >()->default_value(UQ_GCM_PRED_WS_BY_SAMPLING_RVS_ODV              ), "predWsBySamplingRVs"                           )
    (m_option_predWsBySummingRVs.c_str(),              boost::program_options::value<bool        >()->default_value(UQ_GCM_PRED_WS_BY_SUMMING_RVS_ODV               ), "predWsBySummingRVs"                            )
    (m_option_predWsAtKeyPoints.c_str(),               boost::program_options::value<bool        >()->default_value(UQ_GCM_PRED_WS_AT_KEY_POINTS_ODV                ), "predWsAtKeyPoints"                             )
  ;

  return;
}
Example #25
0
	void add_options_to_desc(po::options_description &desc){

		std::string detector_types_str = detector_types_to_str();

		desc.add_options()("help,h", "produce help message")
						("detector-type,d", po::value<std::string>()->default_value("sr"),
								std::string("detector type: ").append(detector_types_str).c_str())
						("number-of-strips,n", po::value<unsigned>()->default_value(3),
								"number of strips in the detector")
						("strip-potential,v", po::value<unsigned>()->default_value(1),
								"strip potential (Volt)")
						("strip-length,l", po::value<unsigned>()->default_value(100),
								"strip length (nm)")
						("strip-width,w", po::value<unsigned>()->default_value(30),
								"strip width (nm)")
						("pitch,p", po::value<unsigned>()->default_value(100),
								"pitch: space between two consecutive strips (nm)")
						("refine-level,r", po::value<unsigned>()->default_value(1),
								"refine level: mesh precision increases exponentially with the refine level as 2^refine_level")
						("error,e", po::value<double>()->default_value(10e-12),
										"tolerance determining the success of the iteration: computation stops when error less or equal than specified error")
						("max-iteration,i", po::value<unsigned>()->default_value(10000),
										"maximum number of iterations allowed to reduce the error until user-specified error is reached (exception thrown if required precision not reached)")
						("output-file,o", po::value<std::string>()->default_value("out.vtk"),
										"results are outputed as a vtk file at specified path");
	}
void mo::DefaultConfiguration::parse_arguments(
    boost::program_options::options_description desc,
    mo::ProgramOption& options,
    int argc,
    char const* argv[]) const
{
    namespace po = boost::program_options;

    try
    {
        desc.add_options()
            ("help,h", "this help text");

        options.parse_arguments(desc, argc, argv);

        auto const unparsed_arguments = options.unparsed_command_line();
        std::vector<char const*> tokens;
        for (auto const& token : unparsed_arguments)
            tokens.push_back(token.c_str());
        if (!tokens.empty()) unparsed_arguments_handler(tokens.size(), tokens.data());

        if (options.is_set("help"))
        {
            std::ostringstream help_text;
            help_text << desc;
            BOOST_THROW_EXCEPTION(mir::AbnormalExit(help_text.str()));
        }
    }
    catch (po::error const& error)
    {
        std::ostringstream help_text;
        help_text << "Failed to parse command line options: " << error.what() << "." << std::endl << desc;
        BOOST_THROW_EXCEPTION(mir::AbnormalExit(help_text.str()));
    }
}
Example #27
0
void PKISignCSRCommand::InitParameters(boost::program_options::options_description& visibleDesc,
    boost::program_options::options_description& hiddenDesc) const
{
	visibleDesc.add_options()
	    ("csr", po::value<std::string>(), "CSR file path (input)")
	    ("cert", po::value<std::string>(), "Certificate file path (output)");
}
Example #28
0
int program_options_usage(int argc, char **argv)
{
	desc.add_options()
	("help,h", "produce help message")
	("version,v", "print version string")
	("proto_test", po::value<int>(&proto_enable)->default_value(0), "exec proto test")
	("soci_test", po::value<int>(&soci_enable)->default_value(0), "exec soci-postgresql test")
	("openssl_test", po::value<int>(&openssl_enable)->default_value(0), "exec openssl test")
	;
	
	po::store(po::parse_command_line(argc, argv, desc), vm);
	po::notify(vm);
	
	if(argc == 1 || vm.count("help"))
	{
		std::cout<< desc<< std::endl;
		return 0;
	}
	
	if(vm.count("version"))
	{
		std::cout<< "Version:0.1" << std::endl;
		return 0;
	}
	
}
Example #29
0
	void Program::addGlobalOptions(po::options_description &options)
	{
		options.add_options()
			("version,v", po::value<bool>(&m_version)->default_value(false)->zero_tokens(), "print program version information")
			("help,h", "display help and exit")
		;
	}
Example #30
0
void CAListCommand::InitParameters(boost::program_options::options_description& visibleDesc,
	boost::program_options::options_description& hiddenDesc) const
{
	visibleDesc.add_options()
		("json", "encode output as JSON")
	;
}