mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
[yul-phaser] Move handling of boost::program_options::error to the top-level exception handler
This commit is contained in:
parent
4e90c598b3
commit
53803801f7
@ -205,17 +205,9 @@ Phaser::CommandLineParsingResult Phaser::parseCommandLine(int _argc, char** _arg
|
||||
po::variables_map arguments;
|
||||
po::notify(arguments);
|
||||
|
||||
try
|
||||
{
|
||||
po::command_line_parser parser(_argc, _argv);
|
||||
parser.options(keywordDescription).positional(positionalDescription);
|
||||
po::store(parser.run(), arguments);
|
||||
}
|
||||
catch (po::error const & _exception)
|
||||
{
|
||||
cerr << _exception.what() << endl;
|
||||
return {1, move(arguments)};
|
||||
}
|
||||
po::command_line_parser parser(_argc, _argv);
|
||||
parser.options(keywordDescription).positional(positionalDescription);
|
||||
po::store(parser.run(), arguments);
|
||||
|
||||
if (arguments.count("help") > 0)
|
||||
{
|
||||
|
@ -28,6 +28,14 @@ int main(int argc, char** argv)
|
||||
{
|
||||
return solidity::phaser::Phaser::main(argc, argv);
|
||||
}
|
||||
catch (boost::program_options::error const& exception)
|
||||
{
|
||||
// Bad input data. Invalid command-line parameters.
|
||||
|
||||
std::cerr << std::endl;
|
||||
std::cerr << "ERROR: " << exception.what() << std::endl;
|
||||
return 1;
|
||||
}
|
||||
catch (solidity::phaser::InvalidProgram const& exception)
|
||||
{
|
||||
// Error in the input data. One of the provided programs contains errors and could not be loaded.
|
||||
|
Loading…
Reference in New Issue
Block a user