diff options
author | Leonardo Alt <leo@ethereum.org> | 2018-04-24 21:18:12 +0800 |
---|---|---|
committer | Leonardo Alt <leo@ethereum.org> | 2018-05-07 15:32:46 +0800 |
commit | db5ea8ec0325512af3238918ca0ea297488a5c5d (patch) | |
tree | d9cacf7fb0054f109b30c9f4ad0574d6ada7d5c4 /solc/CommandLineInterface.cpp | |
parent | dc857feb4f1c50516e5a27bff464d0452a2ad1a1 (diff) | |
download | dexon-solidity-db5ea8ec0325512af3238918ca0ea297488a5c5d.tar.gz dexon-solidity-db5ea8ec0325512af3238918ca0ea297488a5c5d.tar.zst dexon-solidity-db5ea8ec0325512af3238918ca0ea297488a5c5d.zip |
Read from stdin only if - is explicitly given
Diffstat (limited to 'solc/CommandLineInterface.cpp')
-rw-r--r-- | solc/CommandLineInterface.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/solc/CommandLineInterface.cpp b/solc/CommandLineInterface.cpp index 1f04c68a..89ac8806 100644 --- a/solc/CommandLineInterface.cpp +++ b/solc/CommandLineInterface.cpp @@ -404,9 +404,7 @@ bool CommandLineInterface::readInputFilesAndConfigureRemappings() { bool ignoreMissing = m_args.count(g_argIgnoreMissingFiles); bool addStdin = false; - if (!m_args.count(g_argInputFile)) - addStdin = true; - else + if (m_args.count(g_argInputFile)) for (string path: m_args[g_argInputFile].as<vector<string>>()) { auto eq = find(path.begin(), path.end(), '='); @@ -450,6 +448,11 @@ bool CommandLineInterface::readInputFilesAndConfigureRemappings() } if (addStdin) m_sourceCodes[g_stdinFileName] = dev::readStandardInput(); + if (m_sourceCodes.size() == 0) + { + cerr << "No input files given. If you wish to use the standard input please specify \"-\" explicity." << endl; + return false; + } return true; } |