From b41bd046364da16ac037f4f1a5a5ffe642ad682a Mon Sep 17 00:00:00 2001 From: Thomas Monjalon Date: Fri, 4 Nov 2022 12:30:18 +0100 Subject: [PATCH] usertools/hugepages: show usage if no action specified Previously, the script was doing nothing if no argument was provided. If neither show, mount/unmount, clear/reserve are specified, it is assumed that the user does not know how to use the script. So the usage and an error message are printed. The exit code will be non-zero. The user will understand something is wrong, and can recall the script with the option -h to get more information. Signed-off-by: Thomas Monjalon Acked-by: David Marchand --- usertools/dpdk-hugepages.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/usertools/dpdk-hugepages.py b/usertools/dpdk-hugepages.py index a22d504d3a..bf2575ba36 100755 --- a/usertools/dpdk-hugepages.py +++ b/usertools/dpdk-hugepages.py @@ -272,6 +272,9 @@ def main(): args.reserve = args.setup args.mount = True + if not (args.show or args.mount or args.unmount or args.clear or args.reserve): + parser.error("no action specified") + if args.pagesize: pagesize_kb = get_memsize(args.pagesize) else: