diff options
Diffstat (limited to 'solc')
-rw-r--r-- | solc/CommandLineInterface.cpp | 39 | ||||
-rw-r--r-- | solc/jsonCompiler.cpp | 3 |
2 files changed, 18 insertions, 24 deletions
diff --git a/solc/CommandLineInterface.cpp b/solc/CommandLineInterface.cpp index ec87b891..08c08797 100644 --- a/solc/CommandLineInterface.cpp +++ b/solc/CommandLineInterface.cpp @@ -65,7 +65,6 @@ namespace solidity { static string const g_argAbiStr = "abi"; -static string const g_argSolInterfaceStr = "interface"; static string const g_argSignatureHashes = "hashes"; static string const g_argGas = "gas"; static string const g_argAsmStr = "asm"; @@ -116,7 +115,6 @@ static bool needsHumanTargetedStdout(po::variables_map const& _args) return false; for (string const& arg: { g_argAbiStr, - g_argSolInterfaceStr, g_argSignatureHashes, g_argNatspecUserStr, g_argAstJson, @@ -215,11 +213,6 @@ void CommandLineInterface::handleMeta(DocumentationType _type, string const& _co suffix = ".abi"; title = "Contract JSON ABI"; break; - case DocumentationType::ABISolidityInterface: - argName = g_argSolInterfaceStr; - suffix = "_interface.sol"; - title = "Contract Solidity ABI"; - break; case DocumentationType::NatspecUser: argName = g_argNatspecUserStr; suffix = ".docuser"; @@ -310,21 +303,18 @@ void CommandLineInterface::handleFormal() void CommandLineInterface::readInputFilesAndConfigureRemappings() { + vector<string> inputFiles; + bool addStdin = false; if (!m_args.count("input-file")) - { - string s; - while (!cin.eof()) - { - getline(cin, s); - m_sourceCodes[g_stdinFileName].append(s + '\n'); - } - } + addStdin = true; else for (string path: m_args["input-file"].as<vector<string>>()) { auto eq = find(path.begin(), path.end(), '='); if (eq != path.end()) path = string(eq + 1, path.end()); + else if (path == "-") + addStdin = true; else { auto infile = boost::filesystem::path(path); @@ -345,6 +335,15 @@ void CommandLineInterface::readInputFilesAndConfigureRemappings() } m_allowedDirectories.push_back(boost::filesystem::path(path).remove_filename()); } + if (addStdin) + { + string s; + while (!cin.eof()) + { + getline(cin, s); + m_sourceCodes[g_stdinFileName].append(s + '\n'); + } + } } bool CommandLineInterface::parseLibraryOption(string const& _input) @@ -399,9 +398,9 @@ bool CommandLineInterface::parseArguments(int _argc, char** _argv) po::options_description desc( R"(solc, the Solidity commandline compiler. Usage: solc [options] [input_file...] -Compiles the given Solidity input files (or the standard input if none given) and -outputs the components specified in the options at standard output or in files in -the output directory, if specified. +Compiles the given Solidity input files (or the standard input if none given or +"-" is used as a file name) and outputs the components specified in the options +at standard output or in files in the output directory, if specified. Example: solc --bin -o /tmp/solcoutput contract.sol Allowed options)", @@ -455,7 +454,6 @@ Allowed options)", (g_argRuntimeBinaryStr.c_str(), "Binary of the runtime part of the contracts in hex.") (g_argCloneBinaryStr.c_str(), "Binary of the clone contracts in hex.") (g_argAbiStr.c_str(), "ABI specification of the contracts.") - (g_argSolInterfaceStr.c_str(), "Solidity interface of the contracts.") (g_argSignatureHashes.c_str(), "Function signature hashes of the contracts.") (g_argNatspecUserStr.c_str(), "Natspec user documentation of all contracts.") (g_argNatspecDevStr.c_str(), "Natspec developer documentation of all contracts.") @@ -643,8 +641,6 @@ void CommandLineInterface::handleCombinedJSON() for (string const& contractName: contracts) { Json::Value contractData(Json::objectValue); - if (requests.count("interface")) - contractData["interface"] = m_compiler->solidityInterface(contractName); if (requests.count("abi")) contractData["abi"] = m_compiler->interface(contractName); if (requests.count("bin")) @@ -901,7 +897,6 @@ void CommandLineInterface::outputCompilationResults() handleBytecode(contract); handleSignatureHashes(contract); handleMeta(DocumentationType::ABIInterface, contract); - handleMeta(DocumentationType::ABISolidityInterface, contract); handleMeta(DocumentationType::NatspecDev, contract); handleMeta(DocumentationType::NatspecUser, contract); } // end of contracts iteration diff --git a/solc/jsonCompiler.cpp b/solc/jsonCompiler.cpp index 20112103..896a5922 100644 --- a/solc/jsonCompiler.cpp +++ b/solc/jsonCompiler.cpp @@ -207,7 +207,6 @@ string compile(StringMap const& _sources, bool _optimize, CStyleReadFileCallback for (string const& contractName: compiler.contractNames()) { Json::Value contractData(Json::objectValue); - contractData["solidity_interface"] = compiler.solidityInterface(contractName); contractData["interface"] = compiler.interface(contractName); contractData["bytecode"] = compiler.object(contractName).toHex(); contractData["runtimeBytecode"] = compiler.runtimeObject(contractName).toHex(); @@ -217,7 +216,7 @@ string compile(StringMap const& _sources, bool _optimize, CStyleReadFileCallback auto sourceMap = compiler.sourceMapping(contractName); contractData["srcmap"] = sourceMap ? *sourceMap : ""; auto runtimeSourceMap = compiler.runtimeSourceMapping(contractName); - contractData["srcmap-runtime"] = runtimeSourceMap ? *runtimeSourceMap : ""; + contractData["srcmapRuntime"] = runtimeSourceMap ? *runtimeSourceMap : ""; ostringstream unused; contractData["assembly"] = compiler.streamAssembly(unused, contractName, _sources, true); output["contracts"][contractName] = contractData; |