Skip to contentSkip to conversation

Add option to support version

PATCH In review Yang Gu 2 participants 2 messages Nov 3, 2010

lore
Share & tools
lore

Yang Gu

author
#0 lore raw

PATCH v2 1/1 Add option to support version

---
 src/main.cpp |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
src/main.cpp +5 -2
index d7de416..d601ac2 100644
@@ -28,7 +28,7 @@ static void usage()
 {
     qWarning() << "Usage:"
                << QFileInfo(QCoreApplication::instance()->applicationFilePath()).fileName().toLocal8Bit().constData()
-               << "[-p port] [-gui] filename";
+               << "[-v] [-p port] [-gui] filename";
     exit(-1);
 }
 
@@ -43,7 +43,10 @@ int main(int argc, char **argv)
     // Parse the command-line.
     index = 1;
     for (index = 1; index < argc; index++) {
-        if (strcmp(argv[index],"-p") == 0) {
+        if (strcmp(argv[index],"-v") == 0) {
+            qWarning() << VERSION;
+            exit(0);
+        } else if (strcmp(argv[index],"-p") == 0) {
             index++;
             if (index >= argc) {
                 qWarning() << "ERROR: Got -p but missing port number";
Signature · 1 line
1.7.2.3
#1 lore raw

Hi Yang,

Quoted 2 lines
 src/main.cpp |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

patch has been applied. Thanks.

Regards

Marcel