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:
parent
d748966e39
commit
cb13448179
1
NEWS
1
NEWS
@ -18,6 +18,7 @@ procps-ng NEXT
|
|||||||
* vmstat: Wide mode gives wider proc columns merge #48
|
* vmstat: Wide mode gives wider proc columns merge #48
|
||||||
* watch: Add environment variable for interval merge #62
|
* watch: Add environment variable for interval merge #62
|
||||||
* watch: Add no linewrap option issue #182
|
* watch: Add no linewrap option issue #182
|
||||||
|
* free,uptime,slabtop: complain about extra ops issue #181
|
||||||
|
|
||||||
procps-ng-3.3.16
|
procps-ng-3.3.16
|
||||||
----------------
|
----------------
|
||||||
|
2
free.c
2
free.c
@ -341,6 +341,8 @@ int main(int argc, char **argv)
|
|||||||
default:
|
default:
|
||||||
usage(stderr);
|
usage(stderr);
|
||||||
}
|
}
|
||||||
|
if (optind != argc)
|
||||||
|
usage(stderr);
|
||||||
|
|
||||||
do {
|
do {
|
||||||
|
|
||||||
|
@ -341,6 +341,9 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (optind != argc)
|
||||||
|
usage(stderr);
|
||||||
|
|
||||||
is_tty = isatty(STDIN_FILENO);
|
is_tty = isatty(STDIN_FILENO);
|
||||||
if (is_tty && tcgetattr(STDIN_FILENO, &saved_tty) == -1)
|
if (is_tty && tcgetattr(STDIN_FILENO, &saved_tty) == -1)
|
||||||
xwarn(_("terminal setting retrieval"));
|
xwarn(_("terminal setting retrieval"));
|
||||||
|
Loading…
Reference in New Issue
Block a user