diff options
author | Christian Klinger | 2016-05-30 15:15:14 +0200 |
---|---|---|
committer | Christian Klinger | 2016-05-30 15:15:14 +0200 |
commit | 712724fbefe6042c89781cae1f7b96334a9edad3 (patch) | |
tree | b203f34b3619d174b7c01aa6212ca52656a70d75 /src/client | |
parent | Added "--exam-mode" option. (diff) | |
download | pvs2-712724fbefe6042c89781cae1f7b96334a9edad3.tar.gz pvs2-712724fbefe6042c89781cae1f7b96334a9edad3.tar.xz pvs2-712724fbefe6042c89781cae1f7b96334a9edad3.zip |
added qStdOut() (use like qDebug())
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/main.cpp | 8 | ||||
-rw-r--r-- | src/client/util/util.h | 7 |
2 files changed, 12 insertions, 3 deletions
diff --git a/src/client/main.cpp b/src/client/main.cpp index 602eee7..0b3bc74 100644 --- a/src/client/main.cpp +++ b/src/client/main.cpp @@ -1,6 +1,5 @@ #include "toolbar/toolbar.h" #include "util/util.h" -#include <iostream> int main(int argc, char** argv) { @@ -22,9 +21,12 @@ int main(int argc, char** argv) } else if (a.startsWith("--session=")) { option_session= true; sessionName= a.replace("--session=", ""); - + } else if (a == "--usage" || a == "--help") { + qStdout() << "Usage: pvsclient [--exam-mode] [--auto|--session=xxx|\"\"]" << endl; + exit(0); } else if (!a.endsWith("pvsclient")) { - qDebug() << "ignoring unknown argument: \"" << a << "\""; + qStdout() << "ignoring unknown argument: \"" << a << "\""; + qStdout() << "see --usage for a list of options" << endl; } } diff --git a/src/client/util/util.h b/src/client/util/util.h index b90ce3d..9317ba7 100644 --- a/src/client/util/util.h +++ b/src/client/util/util.h @@ -10,6 +10,7 @@ #define SYSTEM_SETTINGS(name) QSettings name (QSettings::IniFormat, QSettings::SystemScope, "openslx/pvs2", "pvs2") #include <QDir> +#include <QTextStream> namespace Util { @@ -21,5 +22,11 @@ QDir settingsDir(); } +inline QTextStream& qStdout() +{ + static QTextStream r{stdout}; + return r; +} + #endif /* UTIL_H_ */ |