From: Thomas Monjalon <thomas@monjalon.net>
To: dev@dpdk.org
Cc: rjarry@redhat.com, bruce.richardson@intel.com,
stephen@networkplumber.org, dmitry.kozliuk@gmail.com
Subject: [PATCH] usertools/hugepages: show usage if no action specified
Date: Fri, 4 Nov 2022 12:30:18 +0100 [thread overview]
Message-ID: <20221104113018.4069058-1-thomas@monjalon.net> (raw)
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 is printed and an error code is used in exit.
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 <thomas@monjalon.net>
---
usertools/dpdk-hugepages.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/usertools/dpdk-hugepages.py b/usertools/dpdk-hugepages.py
index a22d504d3a..823cfcf185 100755
--- a/usertools/dpdk-hugepages.py
+++ b/usertools/dpdk-hugepages.py
@@ -272,6 +272,10 @@ 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.print_usage()
+ sys.exit(1)
+
if args.pagesize:
pagesize_kb = get_memsize(args.pagesize)
else:
--
2.36.1
next reply other threads:[~2022-11-04 11:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-04 11:30 Thomas Monjalon [this message]
2022-11-07 9:39 ` Robin Jarry
2022-11-22 15:22 ` Thomas Monjalon
2022-11-22 15:32 ` [PATCH v2] " Thomas Monjalon
2022-11-22 15:38 ` David Marchand
2022-11-22 15:42 ` Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221104113018.4069058-1-thomas@monjalon.net \
--to=thomas@monjalon.net \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=dmitry.kozliuk@gmail.com \
--cc=rjarry@redhat.com \
--cc=stephen@networkplumber.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).