From 2531a3695f3a58a7c4be40a62495aa35215835de Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Sun, 6 Jan 2013 16:37:02 +0100 Subject: [PATCH] fixup qcvm parameter handling, now progs.dat can be specified anywhere not just at the end --- exec.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) 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); } -- 2.39.2