MCPcopy Create free account
hub / github.com/argotorg/solidity / processArgs

Method processArgs

solc/CommandLineParser.cpp:999–1595  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

997}
998
999void CommandLineParser::processArgs()
1000{
1001 if (m_args.count(g_strNoColor) > 0)
1002 m_options.formatting.coloredOutput = false;
1003 else if (m_args.count(g_strColor) > 0)
1004 m_options.formatting.coloredOutput = true;
1005
1006 if (m_args.contains(g_strExperimental))
1007 m_options.experimental = true;
1008
1009 checkMutuallyExclusive({
1010 g_strHelp,
1011 g_strLicense,
1012 g_strVersion,
1013 g_strStandardJSON,
1014 g_strLink,
1015 g_strStrictAssembly,
1016 g_strImportAst,
1017 g_strLSP,
1018 g_strImportEvmAssemblerJson,
1019 });
1020
1021 checkExperimental(experimentalOptionNames());
1022
1023 if (m_args.count(g_strHelp) > 0)
1024 m_options.input.mode = InputMode::Help;
1025 else if (m_args.count(g_strLicense) > 0)
1026 m_options.input.mode = InputMode::License;
1027 else if (m_args.count(g_strVersion) > 0)
1028 m_options.input.mode = InputMode::Version;
1029 else if (m_args.count(g_strStandardJSON) > 0)
1030 m_options.input.mode = InputMode::StandardJson;
1031 else if (m_args.count(g_strLSP))
1032 m_options.input.mode = InputMode::LanguageServer;
1033 else if (m_args.contains(g_strStrictAssembly))
1034 m_options.input.mode = InputMode::Assembler;
1035 else if (m_args.count(g_strLink) > 0)
1036 m_options.input.mode = InputMode::Linker;
1037 else if (m_args.count(g_strImportAst) > 0)
1038 m_options.input.mode = InputMode::CompilerWithASTImport;
1039 else if (m_args.count(g_strImportEvmAssemblerJson) > 0)
1040 m_options.input.mode = InputMode::EVMAssemblerJSON;
1041 else
1042 m_options.input.mode = InputMode::Compiler;
1043
1044 if (
1045 m_options.input.mode == InputMode::Help ||
1046 m_options.input.mode == InputMode::License ||
1047 m_options.input.mode == InputMode::Version
1048 )
1049 return;
1050
1051 if (m_options.experimental && m_options.input.mode == InputMode::StandardJson)
1052 solThrow(
1053 CommandLineValidationError,
1054 "Standard JSON input mode is incompatible with the --" + g_strExperimental + " flag. "
1055 "Instead, please use the 'settings.experimental' setting in your Standard JSON input file to "
1056 "enable experimental mode."

Callers

nothing calls this directly

Calls 13

revertStringsFromStringFunction · 0.85
filterFunction · 0.85
atMethod · 0.80
insertMethod · 0.80
supportsEOFMethod · 0.80
optimiserSettingsMethod · 0.80
whatMethod · 0.80
enableMethod · 0.80
to_stringFunction · 0.50
countMethod · 0.45
containsMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected