Skip to content

Commit 5dfa26b

Browse files
committed
aobench: notify on unrecognised args
1 parent 91c317f commit 5dfa26b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

samples/aobench/ao_main.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ int main(int argc, char **argv) {
154154
cli_parse_common_app_arguments(&args.common_app_args, &argc, argv);
155155

156156
bool do_host = false, do_ispc = false, do_device = false, do_all = true;
157-
for (size_t i = 0; i < argc; i++) {
157+
for (size_t i = 1; i < argc; i++) {
158158
if (strcmp(argv[i], "--only-device") == 0) {
159159
do_device = true;
160160
do_all = false;
@@ -164,6 +164,9 @@ int main(int argc, char **argv) {
164164
} else if (strcmp(argv[i], "--only-ispc") == 0) {
165165
do_ispc = true;
166166
do_all = false;
167+
} else {
168+
error_print("Unrecognised argument: %s\n", argv[i]);
169+
error_die();
167170
}
168171
}
169172

0 commit comments

Comments
 (0)