mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-14 02:33:28 -06:00
Parameters::printUsage: remove unused TypeTag tparam
This commit is contained in:
parent
b9d46da4e2
commit
b60f390a21
@ -374,11 +374,10 @@ inline void printParamList_(std::ostream& os,
|
||||
* \param errorMsg The error message to be printed, if any
|
||||
* \param os The \c std::ostream which should be used.
|
||||
*/
|
||||
template <class TypeTag>
|
||||
void printUsage(const std::string& helpPreamble,
|
||||
const std::string& errorMsg = "",
|
||||
std::ostream& os = std::cerr,
|
||||
const bool showAll = false)
|
||||
inline void printUsage(const std::string& helpPreamble,
|
||||
const std::string& errorMsg = "",
|
||||
std::ostream& os = std::cerr,
|
||||
const bool showAll = false)
|
||||
{
|
||||
if (!errorMsg.empty()) {
|
||||
os << errorMsg << "\n\n";
|
||||
@ -551,11 +550,11 @@ std::string parseCommandLineOptions(int argc,
|
||||
for (int i = 1; i < argc; ++i) {
|
||||
if (std::string("-h") == argv[i]
|
||||
|| std::string("--help") == argv[i]) {
|
||||
printUsage<TypeTag>(helpPreamble, /*errorMsg=*/"", std::cout);
|
||||
printUsage(helpPreamble, /*errorMsg=*/"", std::cout);
|
||||
return "Help called";
|
||||
}
|
||||
if (std::string("--help-all") == argv[i]) {
|
||||
printUsage<TypeTag>(helpPreamble, /*errorMsg=*/"", std::cout, true);
|
||||
printUsage(helpPreamble, /*errorMsg=*/"", std::cout, true);
|
||||
return "Help called";
|
||||
}
|
||||
}
|
||||
@ -577,7 +576,7 @@ std::string parseCommandLineOptions(int argc,
|
||||
std::ostringstream oss;
|
||||
|
||||
if (!helpPreamble.empty())
|
||||
printUsage<TypeTag>(helpPreamble, errorMsg, std::cerr);
|
||||
printUsage(helpPreamble, errorMsg, std::cerr);
|
||||
|
||||
return errorMsg;
|
||||
}
|
||||
@ -602,7 +601,7 @@ std::string parseCommandLineOptions(int argc,
|
||||
<< "is invalid because it does not start with a letter.";
|
||||
|
||||
if (!helpPreamble.empty())
|
||||
printUsage<TypeTag>(helpPreamble, oss.str(), std::cerr);
|
||||
printUsage(helpPreamble, oss.str(), std::cerr);
|
||||
|
||||
return oss.str();
|
||||
}
|
||||
@ -618,7 +617,7 @@ std::string parseCommandLineOptions(int argc,
|
||||
"command line parameter";
|
||||
|
||||
if (!helpPreamble.empty())
|
||||
printUsage<TypeTag>(helpPreamble, msg, std::cerr);
|
||||
printUsage(helpPreamble, msg, std::cerr);
|
||||
return msg;
|
||||
}
|
||||
seenKeys.insert(paramName);
|
||||
@ -629,7 +628,7 @@ std::string parseCommandLineOptions(int argc,
|
||||
+" Please use "+argv[i]+"=value.";
|
||||
|
||||
if (!helpPreamble.empty())
|
||||
printUsage<TypeTag>(helpPreamble, msg, std::cerr);
|
||||
printUsage(helpPreamble, msg, std::cerr);
|
||||
return msg;
|
||||
}
|
||||
|
||||
|
@ -161,7 +161,7 @@ static inline int setupParameters_(int argc,
|
||||
if (myRank == 0) {
|
||||
oss << "Parameter file \"" << paramFileName
|
||||
<< "\" does not exist or is not readable.";
|
||||
Parameters::printUsage<TypeTag>(argv[0], oss.str());
|
||||
Parameters::printUsage(argv[0], oss.str());
|
||||
}
|
||||
return /*status=*/1;
|
||||
}
|
||||
@ -318,17 +318,17 @@ static inline int start(int argc, char **argv, bool registerParams=true)
|
||||
Scalar endTime = Parameters::get<TypeTag, Parameters::EndTime>();
|
||||
if (endTime < -1e50) {
|
||||
if (myRank == 0)
|
||||
Parameters::printUsage<TypeTag>(argv[0],
|
||||
"Mandatory parameter '--end-time' not specified!");
|
||||
Parameters::printUsage(argv[0],
|
||||
"Mandatory parameter '--end-time' not specified!");
|
||||
return 1;
|
||||
}
|
||||
|
||||
Scalar initialTimeStepSize = Parameters::get<TypeTag, Parameters::InitialTimeStepSize>();
|
||||
if (initialTimeStepSize < -1e50) {
|
||||
if (myRank == 0)
|
||||
Parameters::printUsage<TypeTag>(argv[0],
|
||||
"Mandatory parameter '--initial-time-step-size' "
|
||||
"not specified!");
|
||||
Parameters::printUsage(argv[0],
|
||||
"Mandatory parameter '--initial-time-step-size' "
|
||||
"not specified!");
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user