aboutsummaryrefslogtreecommitdiff
path: root/uxd.c
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2024-12-23 18:48:27 -0500
committerB. Watson <urchlay@slackware.uk>2024-12-23 18:48:27 -0500
commit19cfbb2b5d615afdbb429a6dab60a0c47a673e3b (patch)
tree93b94b43b15960cbbe5552ff957ad45ceb512ddf /uxd.c
parent120a83ea1daa575182044add2f0044832cb97570 (diff)
downloaduxd-19cfbb2b5d615afdbb429a6dab60a0c47a673e3b.tar.gz
allow --help/--version anywhere in argv
Diffstat (limited to 'uxd.c')
-rw-r--r--uxd.c6
1 files changed, 3 insertions, 3 deletions
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();
}