diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2021-09-16 17:08:14 -0700 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2021-09-16 17:08:14 -0700 |
commit | 223372f70f4d217f1b2a558e4e474b1d0eeb31c9 (patch) | |
tree | f0e3a8507c4b297d91a20a5428a1b55b363f8fd9 /src | |
parent | 5f2ba43a47246898eabbcb679dd6d711a8dcfda9 (diff) |
vmon: exit w/error on unrecognized flag-like argument
Diffstat (limited to 'src')
-rw-r--r-- | src/vmon.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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; |