Merge pull request #8100 from ethereum/deadTestArguments

Disallow dead positional arguments for (i)soltest
This commit is contained in:
Daniel Kirchner
2020-01-07 16:56:10 +01:00
committed by GitHub
+12 -1
View File
@@ -115,9 +115,20 @@ bool CommonOptions::parse(int argc, char const* const* argv)
po::command_line_parser cmdLineParser(argc, argv);
cmdLineParser.options(options);
po::store(cmdLineParser.run(), arguments);
auto parsedOptions = cmdLineParser.run();
po::store(parsedOptions, arguments);
po::notify(arguments);
for (auto const& parsedOption: parsedOptions.options)
if (parsedOption.position_key >= 0)
{
std::stringstream errorMessage;
errorMessage << "Unrecognized option: ";
for (auto const& token: parsedOption.original_tokens)
errorMessage << token;
throw std::runtime_error(errorMessage.str());
}
return true;
}