Skip to content

Commit

Permalink
hwloc-info: error-out if some options are given after some locations
Browse files Browse the repository at this point in the history
Signed-off-by: Brice Goglin <Brice.Goglin@inria.fr>
  • Loading branch information
bgoglin committed Sep 1, 2020
1 parent d84ec38 commit 7b3262f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions utils/hwloc/hwloc-info.c
Expand Up @@ -685,6 +685,9 @@ main (int argc, char *argv[])
while (argc >= 1) {
if (!strcmp(argv[0], "all") || !strcmp(argv[0], "root")) {
hwloc_calc_process_location_info_cb(&lcontext, NULL, hwloc_get_root_obj(topology));
} else if (*argv[0] == '-') {
fprintf(stderr, "Cannot handle command-line option %s after some locations.\n", argv[0]);
return EXIT_FAILURE;
} else {
/* try to match a type/depth followed by a special character */
typelen = strspn(argv[0], "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789");
Expand Down

0 comments on commit 7b3262f

Please sign in to comment.