diff options
author | B. Watson <urchlay@slackware.uk> | 2024-12-23 18:48:27 -0500 |
---|---|---|
committer | B. Watson <urchlay@slackware.uk> | 2024-12-23 18:48:27 -0500 |
commit | 19cfbb2b5d615afdbb429a6dab60a0c47a673e3b (patch) | |
tree | 93b94b43b15960cbbe5552ff957ad45ceb512ddf | |
parent | 120a83ea1daa575182044add2f0044832cb97570 (diff) | |
download | uxd-19cfbb2b5d615afdbb429a6dab60a0c47a673e3b.tar.gz |
allow --help/--version anywhere in argv
-rw-r--r-- | uxd.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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(); } |