aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--solc/CommandLineInterface.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/solc/CommandLineInterface.cpp b/solc/CommandLineInterface.cpp
index 003ad030..21624b3b 100644
--- a/solc/CommandLineInterface.cpp
+++ b/solc/CommandLineInterface.cpp
@@ -22,6 +22,13 @@
*/
#include "CommandLineInterface.h"
+#ifdef _WIN32 // windows
+ #include <io.h>
+ #define isatty _isatty
+ #define fileno _fileno
+#else // unix
+ #include <unistd.h>
+#endif
#include <string>
#include <iostream>
#include <fstream>
@@ -478,7 +485,7 @@ Allowed options)",
return false;
}
- if (m_args.count("help"))
+ if (m_args.count("help") || (isatty(fileno(stdin)) && _argc == 1))
{
cout << desc;
return false;