CommandLineHelpers.cc File Reference

Functions

template<>
std::string helpers::readFromCommandLine< std::string > (int argc, char *argv[], std::string varName, std::string value)
 

Function Documentation

◆ helpers::readFromCommandLine< std::string >()

template<>
std::string helpers::readFromCommandLine< std::string > ( int  argc,
char argv[],
std::string  varName,
std::string  value 
)
81 {
82  for (int i = 0; i < argc - 1; ++i) {
83  if (varName == argv[i]) {
84  value = argv[i+1];
85  logger(INFO, "readFromCommandLine: % set to % ", varName.substr(1), value);
86  return value;
87  }
88  }
89  //if the variable is not found
90  logger(INFO, "readFromCommandLine: % set to default value % ", varName.substr(1), value);
91  return value;
92 }
LL< Log::INFO > INFO
Info log level.
Definition: Logger.cc:55
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
const std::complex< Mdouble > i
Definition: ExtendedMath.h:51

References constants::i, INFO, and logger.