much better and simpler way of handling this

This commit is contained in:
VoR0220 2016-05-13 13:51:41 -05:00
parent 73ede5bb38
commit fb89e69061

View File

@ -22,6 +22,13 @@
*/ */
#include "CommandLineInterface.h" #include "CommandLineInterface.h"
#ifdef _WIN32 // windows
#include <io.h>
#define isatty _isatty
#define fileno _fileno
#else // unix
#include <unistd.h>
#endif
#include <string> #include <string>
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>
@ -478,7 +485,7 @@ Allowed options)",
return false; return false;
} }
if (m_args.count("help")) if (m_args.count("help") || (isatty(fileno(stdin)) && _argc == 1))
{ {
cout << desc; cout << desc;
return false; return false;