mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #8100 from ethereum/deadTestArguments
Disallow dead positional arguments for (i)soltest
This commit is contained in:
commit
70a2902714
@ -115,9 +115,20 @@ bool CommonOptions::parse(int argc, char const* const* argv)
|
|||||||
|
|
||||||
po::command_line_parser cmdLineParser(argc, argv);
|
po::command_line_parser cmdLineParser(argc, argv);
|
||||||
cmdLineParser.options(options);
|
cmdLineParser.options(options);
|
||||||
po::store(cmdLineParser.run(), arguments);
|
auto parsedOptions = cmdLineParser.run();
|
||||||
|
po::store(parsedOptions, arguments);
|
||||||
po::notify(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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user