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

Method parseArguments

solc/CommandLineInterface.cpp:799–828  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

797}
798
799bool CommandLineInterface::parseArguments(int _argc, char const* const* _argv)
800{
801 CommandLineParser parser;
802
803 if (isatty(fileno(stdin)) && _argc == 1)
804 {
805 // If the terminal is taking input from the user, provide more user-friendly output.
806 CommandLineParser::printHelp(sout());
807
808 // In this case we want to exit with an error but not display any error message.
809 return false;
810 }
811
812 try
813 {
814 parser.parse(_argc, _argv);
815 }
816 catch (...)
817 {
818 // Even if the overall CLI parsing fails, the --color/--no-color options may have been
819 // successfully parsed, and if so, should be taken into account when printing errors.
820 // If no value is present, it's possible that --no-color is still there but parsing failed
821 // due to other, unrecognized options so play it safe and disable color in that case.
822 m_options.formatting.coloredOutput = parser.options().formatting.coloredOutput.value_or(false);
823 throw;
824 }
825 m_options = parser.options();
826
827 return true;
828}
829
830void CommandLineInterface::processInput()
831{

Callers 1

Calls 2

optionsMethod · 0.80
parseMethod · 0.45

Tested by

no test coverage detected