summaryrefslogtreecommitdiff
path: root/tools/testing/memblock
diff options
context:
space:
mode:
authorRebecca Mckeever <remckee0@gmail.com>2022-08-14 00:50:19 -0500
committerMike Rapoport <rppt@linux.ibm.com>2022-08-30 13:11:14 +0300
commitc0f1bc4e91c52be73ae1a5e6fd53371f5a7f0333 (patch)
tree3d91fb5c659cc4f1f9278974cd3100756ce5df1b /tools/testing/memblock
parentb90cb1053190353cc30f0fef0ef1f378ccc063c5 (diff)
memblock tests: add command line help option
Add a help command line option to the help message. Add the help option to the short and long options so it will be recognized as a valid option. Usage: $ ./main -h Or: $ ./main --help Reviewed-by: David Hildenbrand <david@redhat.com> Signed-off-by: Rebecca Mckeever <remckee0@gmail.com> Signed-off-by: Mike Rapoport <rppt@linux.ibm.com> Link: https://lore.kernel.org/r/0f3b93a79de78c0da1ca90f74fe35e9a85c7cf93.1660451025.git.remckee0@gmail.com
Diffstat (limited to 'tools/testing/memblock')
-rw-r--r--tools/testing/memblock/tests/common.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/testing/memblock/tests/common.c b/tools/testing/memblock/tests/common.c
index e43b2676af81..76a8ad818f3a 100644
--- a/tools/testing/memblock/tests/common.c
+++ b/tools/testing/memblock/tests/common.c
@@ -14,14 +14,16 @@ static struct test_memory memory_block;
static const char __maybe_unused *prefixes[PREFIXES_MAX];
static int __maybe_unused nr_prefixes;
-static const char *short_opts = "mv";
+static const char *short_opts = "hmv";
static const struct option long_opts[] = {
+ {"help", 0, NULL, 'h'},
{"movable-node", 0, NULL, 'm'},
{"verbose", 0, NULL, 'v'},
{NULL, 0, NULL, 0}
};
static const char * const help_opts[] = {
+ "display this help message and exit",
"disallow allocations from regions marked as hotplugged\n\t\t\t"
"by simulating enabling the \"movable_node\" kernel\n\t\t\t"
"parameter",