summaryrefslogtreecommitdiff
path: root/examples/websockets/echoclient/main.cpp
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>2015-02-20 15:38:55 +0100
committerFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>2015-02-20 15:38:55 +0100
commitb797778da01f72e64cda8680f29f3fa8434ffb0a (patch)
treea917f080b40188e8f937a50b29e47898e9709a51 /examples/websockets/echoclient/main.cpp
parenta834ce5889dc3a79eebe1ac0a1576603b68f5a4b (diff)
parent85a8ea105646c7d871f982b890ef5f6faa91824d (diff)
downloadqtwebsockets-b797778da01f72e64cda8680f29f3fa8434ffb0a.tar.gz
Merge remote-tracking branch 'origin/5.4' into 5.5
Change-Id: I96657102802860c8490c162462324e661592d879
Diffstat (limited to 'examples/websockets/echoclient/main.cpp')
-rw-r--r--examples/websockets/echoclient/main.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/examples/websockets/echoclient/main.cpp b/examples/websockets/echoclient/main.cpp
index cdc6d04..911c069 100644
--- a/examples/websockets/echoclient/main.cpp
+++ b/examples/websockets/echoclient/main.cpp
@@ -31,12 +31,25 @@
**
****************************************************************************/
#include <QtCore/QCoreApplication>
+#include <QtCore/QCommandLineParser>
+#include <QtCore/QCommandLineOption>
#include "echoclient.h"
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
- EchoClient client(QUrl(QStringLiteral("ws://localhost:1234")));
+
+ QCommandLineParser parser;
+ parser.setApplicationDescription("QtWebSockets example: echoclient");
+ parser.addHelpOption();
+
+ QCommandLineOption dbgOption(QStringList() << "d" << "debug",
+ QCoreApplication::translate("main", "Debug output [default: off]."));
+ parser.addOption(dbgOption);
+ parser.process(a);
+ bool debug = parser.isSet(dbgOption);
+
+ EchoClient client(QUrl(QStringLiteral("ws://localhost:1234")), debug);
QObject::connect(&client, &EchoClient::closed, &a, &QCoreApplication::quit);
return a.exec();