mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Disallow positional arguments for (i)soltest instead of ignoring
This commit is contained in:
parent
f7624e254c
commit
3e714913a0
@ -117,9 +117,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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user