Fixed #3489 ('cppcheck-gui -h' doesnt work on WinXP)

This commit is contained in:
Alexander Mai 2012-09-26 20:26:46 +02:00 committed by Daniel Marjamäki
parent 9f7a0146d0
commit b15cb09af6
1 changed files with 18 additions and 6 deletions

View File

@ -23,6 +23,7 @@
#include <QTranslator> #include <QTranslator>
#include <QMetaType> #include <QMetaType>
#include <QStringList> #include <QStringList>
#include <QMessageBox> // currently used only on _WIN32
#include <iostream> #include <iostream>
#include "mainwindow.h" #include "mainwindow.h"
#include "erroritem.h" #include "erroritem.h"
@ -67,10 +68,21 @@ bool CheckArgs(const QStringList &args)
void ShowUsage() void ShowUsage()
{ {
std::cout << "Cppcheck GUI.\n\n"; const char helpMessage[] =
std::cout << "Syntax:\n"; "Cppcheck GUI.\n\n"
std::cout << " cppcheck-gui [OPTIONS] [files or paths]\n\n"; "Syntax:\n"
std::cout << "Options:\n"; " cppcheck-gui [OPTIONS] [files or paths]\n\n"
std::cout << " -h, --help Print this help\n"; "Options:\n"
std::cout << " -p <file> Open given project file and start checking it\n"; " -h, --help Print this help\n"
" -p <file> Open given project file and start checking it\n";
#if defined(_WIN32)
QMessageBox msgBox(QMessageBox::Information,
"Cppcheck GUI",
helpMessage,
QMessageBox::Ok
);
(void)msgBox.exec();
#else
std::cout << helpMessage;
#endif
} }