From 96b6448d5d36e6b0dd723d811c52db45a76e2756 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 18 Oct 2017 12:02:05 +0200 Subject: chmem: cleanup usage() Just to be compatible with another u-l tools. Signed-off-by: Karel Zak --- sys-utils/chmem.c | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) (limited to 'sys-utils/chmem.c') diff --git a/sys-utils/chmem.c b/sys-utils/chmem.c index 2f0680de8..8d8e395ea 100644 --- a/sys-utils/chmem.c +++ b/sys-utils/chmem.c @@ -328,7 +328,7 @@ static void parse_parameter(struct chmem_desc *desc, char *param) static void __attribute__((__noreturn__)) usage(void) { FILE *out = stdout; - unsigned int i; + size_t i; fputs(USAGE_HEADER, out); fprintf(out, _(" %s [options] [SIZE|RANGE|BLOCKRANGE]\n"), program_invocation_short_name); @@ -337,20 +337,16 @@ static void __attribute__((__noreturn__)) usage(void) fputs(_("Set a particular size or range of memory online or offline.\n"), out); fputs(USAGE_OPTIONS, out); - fputs(_(" -e, --enable enable memory\n"), out); - fputs(_(" -d, --disable disable memory\n"), out); - fputs(_(" -b, --blocks use memory blocks\n"), out); - fputs(_(" -z, --zone select memory zone ("), out); - for (i = 0; i < ARRAY_SIZE(zone_names); i++) { - fputs(zone_names[i], out); - if (i < ARRAY_SIZE(zone_names) - 1) - fputc('|', out); - } - fputs(")\n", out); - - fputs(_(" -v, --verbose verbose output\n"), out); - fputs(USAGE_SEPARATOR, out); - printf(USAGE_HELP_OPTIONS(16)); + fputs(_(" -e, --enable enable memory\n"), out); + fputs(_(" -d, --disable disable memory\n"), out); + fputs(_(" -b, --blocks use memory blocks\n"), out); + fputs(_(" -z, --zone select memory zone (see below)\n"), out); + fputs(_(" -v, --verbose verbose output\n"), out); + printf(USAGE_HELP_OPTIONS(20)); + + fputs(_("\nSupported zones:\n"), out); + for (i = 0; i < ARRAY_SIZE(zone_names); i++) + fprintf(out, " %s\n", zone_names[i]); printf(USAGE_MAN_TAIL("chmem(8)")); -- cgit v1.2.3-55-g7522