changeset 2058:ed3f1b5094ad

Parse this one earlier, to avoid trying to connect to a display first
author Chris Cannam
date Thu, 01 Nov 2018 10:56:58 +0000
parents c0afaca5a029
children 2cad3bf55850 6e9a125ac5f3
files main/main.cpp
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/main/main.cpp	Thu Nov 01 10:43:17 2018 +0000
+++ b/main/main.cpp	Thu Nov 01 10:56:58 2018 +0000
@@ -230,6 +230,12 @@
 int
 main(int argc, char **argv)
 {
+    if (argc == 2 && (QString(argv[1]) == "--version" ||
+                      QString(argv[1]) == "-v")) {
+        cerr << SV_VERSION << endl;
+        exit(0);
+    }
+
     svSystemSpecificInitialisation();
 
 #ifdef Q_WS_X11
@@ -266,11 +272,6 @@
         exit(2);
     }
 
-    if (args.contains("--version") || args.contains("-v")) {
-        cerr << SV_VERSION << endl;
-        exit(0);
-    }
-        
     if (args.contains("--no-audio")) audioOutput = false;
     if (args.contains("--no-osc")) oscSupport = false;