mirror of
				https://github.com/ethereum/solidity
				synced 2023-10-03 13:03:40 +00:00 
			
		
		
		
	Merge pull request #9269 from ethereum/commandline-clearer-error-for-options-disallowed-in-asm-mode
Only actually specified options in command-line error in assembly mode
This commit is contained in:
		
						commit
						0ffe0f7c25
					
				| @ -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