From 19cfbb2b5d615afdbb429a6dab60a0c47a673e3b Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Mon, 23 Dec 2024 18:48:27 -0500 Subject: allow --help/--version anywhere in argv --- uxd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'uxd.c') diff --git a/uxd.c b/uxd.c index 316cb19..1e81ac1 100644 --- a/uxd.c +++ b/uxd.c @@ -280,10 +280,10 @@ long parse_number(int opt, const char *s) { void parse_args(int argc, char **argv) { int opt; - if(argc > 1) { - if(strcmp(argv[1], "--help") == 0) + for(opt = 1; opt < argc; opt++) { + if(strcmp(argv[opt], "--help") == 0) usage(); - if(strcmp(argv[1], "--version") == 0) + if(strcmp(argv[opt], "--version") == 0) version(); } -- cgit v1.2.3