Added call to addOptions virtual helper in CommonOptions::parse to add options from base/derived classes, modified interface of IsolTestOptions to include editor member variable set based on provided parameter in constructor as it is now needed by addOptions helper function

This commit is contained in:
Sean Hawkes 2021-09-18 05:43:09 -05:00
parent f47e918caa
commit ae7c617711
4 changed files with 5 additions and 2 deletions

View File

@ -144,6 +144,7 @@ void CommonOptions::validate() const
bool CommonOptions::parse(int argc, char const* const* argv)
{
po::variables_map arguments;
addOptions();
po::command_line_parser cmdLineParser(argc, argv);
cmdLineParser.options(options);

View File

@ -70,7 +70,7 @@ struct CommonOptions
langutil::EVMVersion evmVersion() const;
virtual addOptions();
virtual void addOptions();
virtual bool parse(int argc, char const* const* argv);
// Throws a ConfigException on error
virtual void validate() const;

View File

@ -59,6 +59,7 @@ std::string editorPath()
IsolTestOptions::IsolTestOptions(std::string* _editor):
CommonOptions(description)
{
editor = _editor;
enforceViaYul = true;
enforceGasTest = (evmVersion() == langutil::EVMVersion{});
enforceGasTestMinValue = 100000;

View File

@ -33,8 +33,9 @@ struct IsolTestOptions: CommonOptions
bool noColor = false;
bool acceptUpdates = false;
std::string testFilter = std::string{};
std::string editor = std::string{};
IsolTestOptions(std::string* _editor);
explicit IsolTestOptions(const std::string* _editor);
void addOptions() override;
bool parse(int _argc, char const* const* _argv) override;
void validate() const override;