free,slabtop,uptime: complain about extra ops

free, slabtop and uptime would happily take extra command line
arguments and doing nothing about them. The programs now check
optind after option processing and will give you usage screen
if there is anything extra.

References:
 procps-ng/procps#181
This commit is contained in:
Craig Small
2020-10-19 22:36:06 +11:00
parent d748966e39
commit cb13448179
4 changed files with 9 additions and 0 deletions

2
free.c
View File

@ -341,6 +341,8 @@ int main(int argc, char **argv)
default:
usage(stderr);
}
if (optind != argc)
usage(stderr);
do {