mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
CommandLineInterface: In error message about options disallowed in assembly mode only include the names of actually used options
This commit is contained in:
parent
8fde9fd1c3
commit
3f3f8adcb8
@ -59,6 +59,7 @@
|
||||
#include <boost/filesystem.hpp>
|
||||
#include <boost/filesystem/operations.hpp>
|
||||
#include <boost/range/adaptor/transformed.hpp>
|
||||
#include <boost/range/adaptor/filtered.hpp>
|
||||
#include <boost/algorithm/string.hpp>
|
||||
|
||||
#ifdef _WIN32 // windows
|
||||
@ -1200,9 +1201,14 @@ bool CommandLineInterface::processInput()
|
||||
};
|
||||
if (countEnabledOptions(nonAssemblyModeOptions) >= 1)
|
||||
{
|
||||
auto optionEnabled = [&](string const& name){ return m_args.count(name) > 0; };
|
||||
auto enabledOptions = boost::copy_range<vector<string>>(nonAssemblyModeOptions | boost::adaptors::filtered(optionEnabled));
|
||||
|
||||
serr() << "The following options are invalid in assembly mode: ";
|
||||
serr() << joinOptionNames(nonAssemblyModeOptions) << ". ";
|
||||
serr() << "Optimization is disabled by default and can be enabled with --" << g_argOptimize << "." << endl;
|
||||
serr() << joinOptionNames(enabledOptions) << ".";
|
||||
if (m_args.count(g_strOptimizeYul) || m_args.count(g_strNoOptimizeYul))
|
||||
serr() << " Optimization is disabled by default and can be enabled with --" << g_argOptimize << "." << endl;
|
||||
serr() << endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -0,0 +1 @@
|
||||
--strict-assembly --optimize-yul
|
@ -0,0 +1 @@
|
||||
The following options are invalid in assembly mode: --optimize-yul. Optimization is disabled by default and can be enabled with --optimize.
|
@ -0,0 +1 @@
|
||||
1
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
sstore(0, 1)
|
||||
}
|
@ -1 +1 @@
|
||||
The following options are invalid in assembly mode: --output-dir, --gas, --combined-json, --optimize-yul, --no-optimize-yul. Optimization is disabled by default and can be enabled with --optimize.
|
||||
The following options are invalid in assembly mode: --output-dir.
|
||||
|
Loading…
Reference in New Issue
Block a user