]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
chmem: cleanup usage()
authorKarel Zak <kzak@redhat.com>
Wed, 18 Oct 2017 10:02:05 +0000 (12:02 +0200)
committerKarel Zak <kzak@redhat.com>
Fri, 20 Oct 2017 10:37:04 +0000 (12:37 +0200)
Just to be compatible with another u-l tools.

Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/chmem.c

index 2f0680de875010c0774c19372b3a3927677bf860..8d8e395eaef60e5e0c35b87f5106a77f4c32d7b4 100644 (file)
@@ -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 <name>  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)"));