summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2021-09-16 17:08:14 -0700
committerVito Caputo <vcaputo@pengaru.com>2021-09-16 17:08:14 -0700
commit223372f70f4d217f1b2a558e4e474b1d0eeb31c9 (patch)
treef0e3a8507c4b297d91a20a5428a1b55b363f8fd9
parent5f2ba43a47246898eabbcb679dd6d711a8dcfda9 (diff)
vmon: exit w/error on unrecognized flag-like argument
-rw-r--r--src/vmon.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/vmon.c b/src/vmon.c
index bb8e3a2..5655759 100644
--- a/src/vmon.c
+++ b/src/vmon.c
@@ -208,7 +208,7 @@ static void print_copyright(void)
"\n"
"This program comes with ABSOLUTELY NO WARRANTY. This is free software, and\n"
"you are welcome to redistribute it under certain conditions. For details\n"
- "please see the LICENSE file included with this program."
+ "please see the LICENSE file included with this program.\n"
);
}
@@ -290,6 +290,9 @@ static int vmon_handle_argv(vmon_t *vmon, int argc, char * const argv[])
} else if (is_flag(*argv, "-h", "--help")) {
print_help();
exit(EXIT_SUCCESS);
+ } else if ((*argv)[0] == '-') {
+ VWM_ERROR("Unrecognized argument: \"%s\", try --help\n", argv[0]);
+ exit(EXIT_FAILURE);
} else {
/* stop looking for more flags on first unrecognized thing, assume we're in command territory now */
break;
© All Rights Reserved