]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
fixup qcvm parameter handling, now progs.dat can be specified anywhere not just at...
authorWolfgang Bumiller <blub@speed.at>
Sun, 6 Jan 2013 15:37:02 +0000 (16:37 +0100)
committerWolfgang Bumiller <blub@speed.at>
Sun, 6 Jan 2013 15:37:02 +0000 (16:37 +0100)
exec.c

diff --git a/exec.c b/exec.c
index 8df96f01145007c37dc4ca4d9bc23c1bcab1109d..2383ad70e5bf23827dae59e657b7877252745d3e 100644 (file)
--- a/exec.c
+++ b/exec.c
@@ -1001,7 +1001,7 @@ int main(int argc, char **argv)
 
             --argc;
             ++argv;
-            if (argc < 3) {
+            if (argc < 2) {
                 usage();
                 exit(1);
             }
@@ -1028,27 +1028,20 @@ int main(int argc, char **argv)
         }
         else
         {
+            printf("unknown parameter: %s\n", argv[1]);
             usage();
             exit(1);
         }
     }
 
-    if (argc > 2) {
-        usage();
-        exit(1);
-    }
-    if (argc > 1) {
-        if (progsfile) {
-            printf("only 1 program file may be specified\n");
-            usage();
-            exit(1);
-        }
+    if (argc == 2 && !progsfile) {
         progsfile = argv[1];
         --argc;
         ++argv;
     }
 
     if (!progsfile) {
+        printf("must specify a program to execute\n");
         usage();
         exit(1);
     }