Moved program_options add_options to a helper function to allow defaults to be set by derived class constructor before immutable options are created by parent

This commit is contained in:
Sean Hawkes
2021-09-18 04:55:50 -05:00
parent 20ca5c1361
commit f47e918caa
4 changed files with 14 additions and 3 deletions
+7 -3
View File
@@ -58,6 +58,13 @@ std::string editorPath()
IsolTestOptions::IsolTestOptions(std::string* _editor):
CommonOptions(description)
{
enforceViaYul = true;
enforceGasTest = (evmVersion() == langutil::EVMVersion{});
enforceGasTestMinValue = 100000;
}
void IsolTestOptions::addOptions()
{
options.add_options()
("editor", po::value<std::string>(_editor)->default_value(editorPath()), "Path to editor for opening test files.")
@@ -76,9 +83,6 @@ bool IsolTestOptions::parse(int _argc, char const* const* _argv)
std::cout << options << std::endl;
return false;
}
enforceViaYul = true;
enforceGasTest = (evmVersion() == langutil::EVMVersion{});
enforceGasTestMinValue = 100000;
return res;
}