mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
ebos: complain about old-style parameter specification explicitly
i.e., complain when detecting foo=bar positional parameters. this is not a bullet-proof solution because it will not work if the deck file name contains an equals character. Anyway, it's better than before IMO.
This commit is contained in:
parent
095a529f28
commit
fe5ccc2194
@ -411,6 +411,22 @@ public:
|
|||||||
typedef typename GET_PROP(TypeTag, ParameterMetaData) ParamsMeta;
|
typedef typename GET_PROP(TypeTag, ParameterMetaData) ParamsMeta;
|
||||||
Dune::ParameterTree& tree = ParamsMeta::tree();
|
Dune::ParameterTree& tree = ParamsMeta::tree();
|
||||||
|
|
||||||
|
std::string param = argv[paramIdx];
|
||||||
|
size_t i = param.find('=');
|
||||||
|
if (i != std::string::npos) {
|
||||||
|
std::string oldParamName = param.substr(0, i);
|
||||||
|
std::string oldParamValue = param.substr(i+1);
|
||||||
|
std::string newParamName = "--" + oldParamName;
|
||||||
|
for (int j = 0; j < newParamName.size(); ++j)
|
||||||
|
if (newParamName[j] == '_')
|
||||||
|
newParamName[j] = '-';
|
||||||
|
errorMsg =
|
||||||
|
"The old syntax to specify parameters on the command line is no longer supported: "
|
||||||
|
"Try replacing '"+oldParamName+"="+oldParamValue+"' with "+
|
||||||
|
"'"+newParamName+"="+oldParamValue+"'!";
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (seenParams.count("EclDeckFileName") > 0) {
|
if (seenParams.count("EclDeckFileName") > 0) {
|
||||||
errorMsg =
|
errorMsg =
|
||||||
"Parameter 'EclDeckFileName' specified multiple times"
|
"Parameter 'EclDeckFileName' specified multiple times"
|
||||||
|
Loading…
Reference in New Issue
Block a user