]> git.ipfire.org Git - thirdparty/util-linux.git/blobdiff - sys-utils/zramctl.c
Merge branch 'patch-23' of https://github.com/mariobl/util-linux
[thirdparty/util-linux.git] / sys-utils / zramctl.c
index 003349fadf2602b42c7544e2caa10019a5628a90..cc32ab4f69c8b9d3dce16125dee9acf55b13e7c3 100644 (file)
@@ -291,7 +291,7 @@ static struct path_cxt *zram_get_control(void)
 
 static int zram_control_add(struct zram *z)
 {
-       int n;
+       int n = 0;
        struct path_cxt *ctl;
 
        if (!zram_has_control(z) || !(ctl = zram_get_control()))
@@ -547,7 +547,7 @@ static void __attribute__((__noreturn__)) usage(void)
        fputs(_("Set up and control zram devices.\n"), out);
 
        fputs(USAGE_OPTIONS, out);
-       fputs(_(" -a, --algorithm lzo|lz4|lz4hc|deflate|842   compression algorithm to use\n"), out);
+       fputs(_(" -a, --algorithm <alg>     compression algorithm to use\n"), out);
        fputs(_(" -b, --bytes               print sizes in bytes rather than in human readable format\n"), out);
        fputs(_(" -f, --find                find a free device\n"), out);
        fputs(_(" -n, --noheadings          don't print headings\n"), out);
@@ -559,16 +559,20 @@ static void __attribute__((__noreturn__)) usage(void)
        fputs(_(" -t, --streams <number>    number of compression streams\n"), out);
 
        fputs(USAGE_SEPARATOR, out);
-       printf(USAGE_HELP_OPTIONS(27));
+       fprintf(out, USAGE_HELP_OPTIONS(27));
 
        fputs(USAGE_ARGUMENTS, out);
-       printf(USAGE_ARG_SIZE(_("<size>")));
+       fprintf(out, USAGE_ARG_SIZE(_("<size>")));
+
+       fputs(_(" <alg> specify algorithm, supported are:\n"), out);
+       fputs(_("   lzo, lz4, lz4hc, deflate, 842 and zstd\n"), out);
+       fputs(_("   (List may be inaccurate, consult man page.)\n"), out);
 
        fputs(USAGE_COLUMNS, out);
        for (i = 0; i < ARRAY_SIZE(infos); i++)
                fprintf(out, " %11s  %s\n", infos[i].name, _(infos[i].help));
 
-       printf(USAGE_MAN_TAIL("zramctl(8)"));
+       fprintf(out, USAGE_MAN_TAIL("zramctl(8)"));
        exit(EXIT_SUCCESS);
 }