Files
s390-tools/zmemtopo/zmemtopo_cli.h
Mete Durlu 1aa1558f91 zmemtopo: Add case-insensitive partition name filtering
Introduce the -p/--partition-filter option to display only partitions
whose names contain a specified substring. The filter performs
case-insensitive matching and applies consistently across all output
formats (table, tree, and reverse tree views).

Example:

$ zmemtopo -p "part74"
LPAR/LEVEL      SIZE
PARTITION74      12G
└LEVEL4_1        12G
  ├LEVEL3_0       3G
  ├LEVEL3_1       3G
  ├LEVEL3_2       3G
  └LEVEL3_3       3G

Suggested-by: Niklas Schnelle <schnelle@linux.ibm.com>
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Mete Durlu <meted@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2026-07-31 09:51:14 +02:00

54 lines
1.4 KiB
C

/*
* SPDX-License-Identifier: MIT
*
* Copyright IBM Corp.
*/
#ifndef ZMEMTOPO_CLI_H
#define ZMEMTOPO_CLI_H
#include "lib/util_fmt.h"
#include "lib/util_opt.h"
#define OPT_FORMAT 256
static struct util_opt opt_vec[] = {
UTIL_OPT_SECTION("OUTPUT FORMAT OPTIONS"),
{
.option = { "level", required_argument, NULL, 'l' },
.argument = "NESTING_LEVEL",
.desc = "Set the topology display depth to NESTING_LEVEL"
}, {
.option = { "format", required_argument, NULL, OPT_FORMAT },
.argument = "FORMAT",
.flags = UTIL_OPT_FLAG_NOSHORT,
.desc = "List data in specified FORMAT (" FMT_TYPE_NAMES ")",
}, {
.option = { "full", no_argument, NULL, 'f' },
.desc = "Display tree view with padded elements"
}, {
.option = { "reverse", no_argument, NULL, 'r' },
.desc = "Reverse tree view hierarchy direction"
}, {
.option = { "table", no_argument, NULL, 't' },
.desc = "Use table view to display topology"
}, {
.option = { "sort", required_argument, NULL, 's' },
.argument = "FIELD",
.desc = "Sort view by FIELD (nr, lpar, size)"
}, {
.option = { "partition-filter", required_argument, NULL, 'p' },
.argument = "SUBSTRING",
.desc = "Filter partitions by name substring (case-insensitive)"
}, {
.option = { "ascii", no_argument, NULL, 'i' },
.desc = "Use only ASCII characters",
},
UTIL_OPT_SECTION("GENERAL OPTIONS"),
UTIL_OPT_HELP,
UTIL_OPT_VERSION,
UTIL_OPT_END
};
#endif