summaryrefslogtreecommitdiff
path: root/examples/websockets/echoclient/main.cpp
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>2015-02-24 12:21:34 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2015-02-24 12:21:34 +0000
commitb01068a406f6ebf51e103dd541f36fd6ef144805 (patch)
tree9a1d2d634ce28672a72dfd1c7565f95cc82c2cb4 /examples/websockets/echoclient/main.cpp
parent9989055693ac6225ae3e6f8153862765b0cd5e7e (diff)
parentb797778da01f72e64cda8680f29f3fa8434ffb0a (diff)
downloadqtwebsockets-b01068a406f6ebf51e103dd541f36fd6ef144805.tar.gz
Merge "Merge remote-tracking branch 'origin/5.4' into 5.5" into refs/staging/5.5
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 91a2535..36157de 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();