From: Wolfgang Bumiller Date: Sun, 6 Jan 2013 15:37:02 +0000 (+0100) Subject: fixup qcvm parameter handling, now progs.dat can be specified anywhere not just at... X-Git-Tag: before-library~360 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=2531a3695f3a58a7c4be40a62495aa35215835de;p=xonotic%2Fgmqcc.git fixup qcvm parameter handling, now progs.dat can be specified anywhere not just at the end --- diff --git a/exec.c b/exec.c index 8df96f0..2383ad7 100644 --- 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); }