coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] ls: Clarify the effect of option -k


From: Pádraig Brady
Subject: Re: [PATCH] ls: Clarify the effect of option -k
Date: Sat, 2 Dec 2017 16:37:02 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

On 01/12/17 02:26, Jean Delvare wrote:
> Users may expect a different effect from option -k than is actually
> implemented, especially when the effect of that option has changed
> over time. The info page explains it well, but "ls --help" (and thus
> the ls.1 man page) do not.
> 
> * src/ls.c: Improve the description of option -k.
> ---
>  src/ls.c |   10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> --- coreutils.orig/src/ls.c   2017-12-01 10:14:46.297551197 +0100
> +++ coreutils/src/ls.c        2017-12-01 10:45:17.298050350 +0100
> @@ -5203,7 +5203,15 @@ Sort entries alphabetically if none of -
>    -i, --inode                print the index number of each file\n\
>    -I, --ignore=PATTERN       do not list implied entries matching shell 
> PATTERN\
>  \n\
> -  -k, --kibibytes            default to 1024-byte blocks for disk usage\n\
> +"), stdout);
> +      fputs (_("\
> +  -k, --kibibytes            default to 1024-byte blocks for disk usage;\n\
> +                               affects the per-directory block count written 
> by\
> +\n\
> +                               -l and -s, and the size written by -s, but 
> not\
> +\n\
> +                               the file size written by -l (use\n\
> +                               '--block-size=1024' for that)\n\
>  "), stdout);
>        fputs (_("\
>    -l                         use a long listing format\n\
> 
> 


Way too verbose.
How about:

diff --git a/src/ls.c b/src/ls.c
index 073e135..35367a7 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -5203,7 +5203,9 @@ Sort entries alphabetically if none of -cftuvSUX nor 
--sort is specified.\n\
   -i, --inode                print the index number of each file\n\
   -I, --ignore=PATTERN       do not list implied entries matching shell 
PATTERN\
 \n\
-  -k, --kibibytes            default to 1024-byte blocks for disk usage\n\
+"), stdout);
+      fputs (_("\
+  -k, --kibibytes            default to 1024B blocks for -s and dir 'total's\n\
 "), stdout);
       fputs (_("\
   -l                         use a long listing format\n\




reply via email to

[Prev in Thread] Current Thread [Next in Thread]