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:
Andreas Lauser 2018-08-17 13:30:43 +02:00
parent 095a529f28
commit fe5ccc2194

View File

@ -411,6 +411,22 @@ public:
typedef typename GET_PROP(TypeTag, ParameterMetaData) ParamsMeta;
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) {
errorMsg =
"Parameter 'EclDeckFileName' specified multiple times"