Class to contain and parse command line options.
More...
#include <command_line_options.h>
|
| CommandLineOptions (int argc, const char **argv) |
|
| ~CommandLineOptions () |
|
template<typename T > |
void | AddOption (const std::string &opt, std::string def, const std::string &description="", std::string group="Simulation") |
| Add an extra command line option. More...
|
|
std::string | GetSimulationName () const |
| Return the simulation name that was parsed from argv[0]. More...
|
|
bool | IsSet (std::string option) |
| Check if the argument for the specified option was set. More...
|
|
template<typename T > |
T | Get (const std::string &val) |
|
Class to contain and parse command line options.
Definition at line 37 of file command_line_options.h.
◆ CommandLineOptions()
bdm::CommandLineOptions::CommandLineOptions |
( |
int |
argc, |
|
|
const char ** |
argv |
|
) |
| |
◆ ~CommandLineOptions()
bdm::CommandLineOptions::~CommandLineOptions |
( |
| ) |
|
◆ AddCoreOptions()
void bdm::CommandLineOptions::AddCoreOptions |
( |
| ) |
|
|
private |
◆ AddOption() [1/2]
template<typename T >
void bdm::CommandLineOptions::AddOption |
( |
const std::string & |
opt, |
|
|
std::string |
def, |
|
|
const std::string & |
description = "" , |
|
|
std::string |
group = "Simulation" |
|
) |
| |
|
inline |
◆ AddOption() [2/2]
cxxopts::OptionAdder bdm::CommandLineOptions::AddOption |
( |
std::string |
group = "Simulation" | ) |
|
|
private |
Add an extra command line option.
◆ ExtractSimulationName()
void bdm::CommandLineOptions::ExtractSimulationName |
( |
const char * |
path | ) |
|
|
private |
Return only the executable name given the path
- Parameters
-
path | path and filename of the executable e.g. executable , ./executable , './build/executable' |
- Returns
executable
Definition at line 121 of file command_line_options.cc.
◆ Get()
template<typename T >
T bdm::CommandLineOptions::Get |
( |
const std::string & |
val | ) |
|
|
inline |
◆ GetSimulationName()
std::string bdm::CommandLineOptions::GetSimulationName |
( |
| ) |
const |
◆ HandleCoreOptions()
void bdm::CommandLineOptions::HandleCoreOptions |
( |
| ) |
|
|
private |
◆ IsSet()
bool bdm::CommandLineOptions::IsSet |
( |
std::string |
option | ) |
|
◆ Parse()
void bdm::CommandLineOptions::Parse |
( |
| ) |
|
|
private |
Parse the options with the given command line arguments.
Parse the given command line arguments.
Definition at line 54 of file command_line_options.cc.
◆ operator<<
◆ argc_
int bdm::CommandLineOptions::argc_ |
|
private |
◆ argv_
const char** bdm::CommandLineOptions::argv_ |
|
private |
◆ first_parse_
bool bdm::CommandLineOptions::first_parse_ = true |
|
private |
◆ options_
cxxopts::Options bdm::CommandLineOptions::options_ |
|
private |
◆ parser_
cxxopts::ParseResult* bdm::CommandLineOptions::parser_ = nullptr |
|
private |
◆ sim_name_
std::string bdm::CommandLineOptions::sim_name_ |
|
private |
The documentation for this class was generated from the following files: