aboutsummaryrefslogtreecommitdiffstats
path: root/solc/CommandLineInterface.cpp
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-10-18 19:54:47 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-10-18 19:56:11 +0800
commit6f2865228cb02f0ba0b58990a9d3006dbe2692c6 (patch)
tree8b243e672f2bd2f495215119fd5ee02c4d5c8430 /solc/CommandLineInterface.cpp
parent7186e142b8ea546d98dc8ddb630da47362be8b0a (diff)
downloaddexon-solidity-6f2865228cb02f0ba0b58990a9d3006dbe2692c6.tar
dexon-solidity-6f2865228cb02f0ba0b58990a9d3006dbe2692c6.tar.gz
dexon-solidity-6f2865228cb02f0ba0b58990a9d3006dbe2692c6.tar.bz2
dexon-solidity-6f2865228cb02f0ba0b58990a9d3006dbe2692c6.tar.lz
dexon-solidity-6f2865228cb02f0ba0b58990a9d3006dbe2692c6.tar.xz
dexon-solidity-6f2865228cb02f0ba0b58990a9d3006dbe2692c6.tar.zst
dexon-solidity-6f2865228cb02f0ba0b58990a9d3006dbe2692c6.zip
Add readStandardInput helper
Diffstat (limited to 'solc/CommandLineInterface.cpp')
-rw-r--r--solc/CommandLineInterface.cpp17
1 files changed, 2 insertions, 15 deletions
diff --git a/solc/CommandLineInterface.cpp b/solc/CommandLineInterface.cpp
index b4c9fe82..fe1461b4 100644
--- a/solc/CommandLineInterface.cpp
+++ b/solc/CommandLineInterface.cpp
@@ -430,14 +430,7 @@ 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');
- }
- }
+ m_sourceCodes[g_stdinFileName] = dev::readStandardInput();
}
bool CommandLineInterface::parseLibraryOption(string const& _input)
@@ -731,13 +724,7 @@ bool CommandLineInterface::processInput()
if (m_args.count(g_argStandardJSON))
{
- string input;
- while (!cin.eof())
- {
- string tmp;
- getline(cin, tmp);
- input.append(tmp + "\n");
- }
+ string input = dev::readStandardInput();
StandardCompiler compiler(fileReader);
cout << compiler.compile(input) << endl;
return true;