]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
pipesz: report default size in --help, instead of referring the user
authorBenno Schulenberg <bensberg@telfort.nl>
Fri, 25 Apr 2025 10:34:21 +0000 (12:34 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 29 Apr 2025 11:02:40 +0000 (13:02 +0200)
The man page says where this default size can be found.  In the --help
text it is more useful to directly say what this default size is.

CC: Nathan Sharp <nwsharp@live.com>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
misc-utils/pipesz.c

index 48f07aed7bf74cf2a5a5f8d8d9b167bf1ce83f2b..6eb5cc0010eeba307b4d3f71ea3b9e9e860bb3c8 100644 (file)
@@ -61,6 +61,9 @@ static char opt_verbose = 0;  /* --verbose */
 
 static void __attribute__((__noreturn__)) usage(void)
 {
+       if (ul_path_read_s32(NULL, &opt_size, PIPESZ_DEFAULT_SIZE_FILE))
+               warn(_("cannot parse %s"), PIPESZ_DEFAULT_SIZE_FILE);
+
        fputs(USAGE_HEADER, stdout);
        fprintf(stdout, _(" %s [options] [--set <size>] [--] [command]\n"), program_invocation_short_name);
        fprintf(stdout, _(" %s [options] --get\n"), program_invocation_short_name);
@@ -71,11 +74,8 @@ static void __attribute__((__noreturn__)) usage(void)
 
        fputs(USAGE_OPTIONS, stdout);
        fputsln(_(" -g, --get          examine pipe buffers"), stdout);
-       /* TRANSLATORS: '%s' refers to a system file */
        fprintf(stdout,
-            _(" -s, --set <size>   set pipe buffer sizes\n"
-              "                      size defaults to %s\n"),
-               PIPESZ_DEFAULT_SIZE_FILE);
+               _(" -s, --set <size>   the buffer size to be used (default: %u)\n"), opt_size);
 
        fputs(USAGE_SEPARATOR, stdout);
        fputsln(_(" -f, --file <path>  act on a file"), stdout);