[PATCH 6/6] lscpu: stricter command line parsing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 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 31c8fa8..f21af71 100644
--- a/sys-utils/lscpu.c
+++ b/sys-utils/lscpu.c
@@ -1275,6 +1275,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;
-- 
1.7.5.4

--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux