mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
CommandLineParser: Report errors by raising exceptions
This commit is contained in:
@@ -23,6 +23,8 @@
|
||||
*/
|
||||
#include <solc/CommandLineInterface.h>
|
||||
|
||||
#include <solc/Exceptions.h>
|
||||
|
||||
#include "license.h"
|
||||
#include "solidity/BuildInfo.h"
|
||||
|
||||
@@ -592,9 +594,16 @@ bool CommandLineInterface::parseArguments(int _argc, char const* const* _argv)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool success = parser.parse(_argc, _argv);
|
||||
if (!success)
|
||||
try
|
||||
{
|
||||
parser.parse(_argc, _argv);
|
||||
}
|
||||
catch (CommandLineValidationError const& _exception)
|
||||
{
|
||||
serr() << _exception.what() << endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
m_hasOutput = m_hasOutput || parser.hasOutput();
|
||||
m_options = parser.options();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user