- fix coverity issues

- clean code and typo in comments
This commit is contained in:
winckler
2015-06-26 12:17:54 +02:00
committed by Florian Uhlig
parent 4db91a52eb
commit b855f77060
2 changed files with 24 additions and 46 deletions

View File

@@ -76,6 +76,21 @@ int FairProgOptions::AddToEnvironmentOptions(const po::options_description& optd
return 0;
}
void FairProgOptions::UseConfigFile(const std::string& filename)
{
fUseConfigFile = true;
if (filename.empty())
{
fCmdline_options.add_options()
("config,c", po::value<std::string>(&fConfigFile)->required(), "Path to configuration file");
}
else
{
fConfigFile = filename;
}
}
/// //////////////////////////////////////////////////////////////////////////////////////////////////////
/// Parser
@@ -235,7 +250,7 @@ std::string FairProgOptions::GetStringValue(const std::string& key)
}
catch(std::exception& e)
{
MQLOG(ERROR) << "Problem in boost variable map for the key '" << key << "'";
MQLOG(ERROR) << "Exception thrown for the key '" << key << "'";
MQLOG(ERROR) << e.what();
}
@@ -243,18 +258,6 @@ std::string FairProgOptions::GetStringValue(const std::string& key)
}
/*
int FairProgOptions::ParseAll(const int argc, char** argv, bool AllowUnregistered)
{
// //////////////////////////////////
// Method to overload.
ParseCmdLine(argc,argv,fGenericDesc,fvarmap,AllowUnregistered);
PrintOptions();
return 0;
}
*/
/// //////////////////////////////////////////////////////////////////////////////////////////////////////
/// Print/notify options