Skip to contentSkip to conversation

Force requirement for filename option in cmd line

PATCH In review Gustavo F. Padovan 2 participants 2 messages Nov 9, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Force requirement for filename option in cmd line

---
 src/main.cpp |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
src/main.cpp +6 -1
index d601ac2..d4327b1 100644
@@ -35,7 +35,7 @@ static void usage()
 int main(int argc, char **argv)
 {
     QApplication app(argc, argv);
-    QString filename;
+    QString filename = NULL;
     int port = 12345;
     int index;
     bool with_gui = false;
@@ -71,6 +71,11 @@ int main(int argc, char **argv)
 
     }
 
+    if (filename == NULL) {
+        qWarning() << "ERROR: filename must be the last argument";
+        usage();
+    }
+
     PhoneSimServer *pss = new PhoneSimServer(filename, port, 0);
 
     if (with_gui)
Signature · 1 line
1.7.3.1
#1 lore raw

Hi Gustavo,

Quoted 4 lines · Gustavo F. Padovan
---
 src/main.cpp |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

This patch has been applied, thanks.

Regards,
-Denis