exit(2) on unsupported positional arguments on command line

Change-Id: Id33caf93325074f9e5b2b322ac497b1c21c3f406
This commit is contained in:
Harald Welte 2019-12-03 21:52:49 +01:00
parent 6d839f5354
commit cc0914d018
1 changed files with 5 additions and 0 deletions

View File

@ -455,6 +455,11 @@ static void handle_options(int argc, char **argv)
break;
}
}
if (argc > optind) {
fprintf(stderr, "Unsupported positional arguments on command line\n");
exit(2);
}
}
CTRL_CMD_DEFINE_RO(hnb_info, "info");