diff options
author | Heiko Carstens | 2011-09-15 08:52:34 +0200 |
---|---|---|
committer | Karel Zak | 2011-09-27 14:48:33 +0200 |
commit | 7bbb7829ca33fe2baf6e068485e72bc94f8b0188 (patch) | |
tree | 2eb18fd464355ff81e75d440ebd73ee9727cb8a4 /sys-utils/lscpu.c | |
parent | lscpu: add --offline option (diff) | |
download | kernel-qcow2-util-linux-7bbb7829ca33fe2baf6e068485e72bc94f8b0188.tar.gz kernel-qcow2-util-linux-7bbb7829ca33fe2baf6e068485e72bc94f8b0188.tar.xz kernel-qcow2-util-linux-7bbb7829ca33fe2baf6e068485e72bc94f8b0188.zip |
lscpu: stricter command line parsing
Disallow superfluous commands for lscpu like e.g. "lscpu bla" and let it
fail print the help text instead.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Diffstat (limited to 'sys-utils/lscpu.c')
-rw-r--r-- | sys-utils/lscpu.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys-utils/lscpu.c b/sys-utils/lscpu.c index c636eb7cb..8637ef194 100644 --- a/sys-utils/lscpu.c +++ b/sys-utils/lscpu.c @@ -1289,6 +1289,10 @@ int main(int argc, char *argv[]) usage(stderr); } } + + if (argc != optind) + usage(stderr); + /* set default cpu display mode if none was specified */ if (!mod->online && !mod->offline) { mod->online = 1; |