bug-coreutils
[Top][All Lists]
Advanced

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

bug#22042: don't say K bytes on both head and tail's man pages


From: Bernhard Voelker
Subject: bug#22042: don't say K bytes on both head and tail's man pages
Date: Sat, 28 Nov 2015 21:45:39 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 11/28/2015 09:01 PM, Dan Jacobson wrote:
> On both the head and tail man pages,
> can you kindly not use "K"?
> 
>        -c, --bytes=K
>               output the last K bytes; or use -c +K to output  bytes  starting
>               with the Kth of each file
> 
> K bytes sounds like kilobytes.
> 
> Yes if one reads carefully it doesn't.
> 
> But instead if you used X, then one needn't read carefully and could
> still read the page!
> 
> Or how about B? B bytes. Sounds even better than X.
> 
> Anyway it (K) appears several places on both man pages.

Thanks.
Another good spot.
I'd rather use 'N' as many users would more likely see this as
'N'umeric argument.  The following does that ... plus also switching
2 other placeholders to avoid overlapping with the explanation regarding
the suffixes K, M, G, T, etc.

Have a nice day,
Berny

>From bc5ac10be70600a012e917f17c828bbc73fb2e78 Mon Sep 17 00:00:00 2001
From: Bernhard Voelker <address@hidden>
Date: Sat, 28 Nov 2015 21:39:23 +0100
Subject: [PATCH] doc: avoid confusing K argument in the man pages of head and
 tail

The character 'K' representing numeric user input can be confusing,
especially in the context where it can be suffixed by the multipliers
K, M, G, etc.
Use N instead.

* src/head.c (usage): s/K/N/ in as placeholder in the -c and -n option.
* src/tail.c (usage): Likewise.  Furthermore, disambiguate the place-
holders by using 'U' for the --max-unchanged-stats, and 'S' for the
--sleep-interval options.

Suggested by Dan Jacobson in http://bugs.gnu.org/22042
---
 src/head.c | 10 +++++-----
 src/tail.c | 22 +++++++++++-----------
 2 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/src/head.c b/src/head.c
index e05c219..31d4609 100644
--- a/src/head.c
+++ b/src/head.c
@@ -115,12 +115,12 @@ With more than one FILE, precede each with a header 
giving the file name.\n\
       emit_mandatory_arg_note ();

       fputs (_("\
-  -c, --bytes=[-]K         print the first K bytes of each file;\n\
+  -c, --bytes=[-]N         print the first N bytes of each file;\n\
                              with the leading '-', print all but the last\n\
-                             K bytes of each file\n\
-  -n, --lines=[-]K         print the first K lines instead of the first 10;\n\
+                             N bytes of each file\n\
+  -n, --lines=[-]N         print the first N lines instead of the first 10;\n\
                              with the leading '-', print all but the last\n\
-                             K lines of each file\n\
+                             N lines of each file\n\
 "), stdout);
       fputs (_("\
   -q, --quiet, --silent    never print headers giving file names\n\
@@ -130,7 +130,7 @@ With more than one FILE, precede each with a header giving 
the file name.\n\
       fputs (VERSION_OPTION_DESCRIPTION, stdout);
       fputs (_("\
 \n\
-K may have a multiplier suffix:\n\
+N may have a multiplier suffix:\n\
 b 512, kB 1000, K 1024, MB 1000*1000, M 1024*1024,\n\
 GB 1000*1000*1000, G 1024*1024*1024, and so on for T, P, E, Z, Y.\n\
 "), stdout);
diff --git a/src/tail.c b/src/tail.c
index 223c8f8..ada3373 100644
--- a/src/tail.c
+++ b/src/tail.c
@@ -263,8 +263,8 @@ With more than one FILE, precede each with a header giving 
the file name.\n\
       emit_mandatory_arg_note ();

      fputs (_("\
-  -c, --bytes=K            output the last K bytes; or use -c +K to output\n\
-                             bytes starting with the Kth of each file\n\
+  -c, --bytes=N            output the last N bytes; or use -c +N to output\n\
+                             bytes starting with the Nth of each file\n\
 "), stdout);
      fputs (_("\
   -f, --follow[={name|descriptor}]\n\
@@ -273,11 +273,11 @@ With more than one FILE, precede each with a header 
giving the file name.\n\
   -F                       same as --follow=name --retry\n\
 "), stdout);
      printf (_("\
-  -n, --lines=K            output the last K lines, instead of the last %d;\n\
-                             or use -n +K to output starting with the Kth\n\
-      --max-unchanged-stats=N\n\
+  -n, --lines=N            output the last N lines, instead of the last %d;\n\
+                             or use -n +N to output starting with the Nth\n\
+      --max-unchanged-stats=U\n\
                            with --follow=name, reopen a FILE which has not\n\
-                             changed size after N (default %d) iterations\n\
+                             changed size after U (default %d) iterations\n\
                              to see if it has been unlinked or renamed\n\
                              (this is the usual case of rotated log files);\n\
                              with inotify, this option is rarely useful\n\
@@ -291,19 +291,19 @@ With more than one FILE, precede each with a header 
giving the file name.\n\
       --retry              keep trying to open a file if it is inaccessible\n\
 "), stdout);
      fputs (_("\
-  -s, --sleep-interval=N   with -f, sleep for approximately N seconds\n\
+  -s, --sleep-interval=S   with -f, sleep for approximately S seconds\n\
                              (default 1.0) between iterations;\n\
                              with inotify and --pid=P, check process P at\n\
-                             least once every N seconds\n\
+                             least once every S seconds\n\
   -v, --verbose            always output headers giving file names\n\
 "), stdout);
      fputs (HELP_OPTION_DESCRIPTION, stdout);
      fputs (VERSION_OPTION_DESCRIPTION, stdout);
      fputs (_("\
 \n\
-If the first character of K (the number of bytes or lines) is a '+',\n\
-print beginning with the Kth item from the start of each file, otherwise,\n\
-print the last K items in the file.  K may have a multiplier suffix:\n\
+If the first character of N (the number of bytes or lines) is a '+',\n\
+print beginning with the Nth item from the start of each file, otherwise,\n\
+print the last N items in the file.  N may have a multiplier suffix:\n\
 b 512, kB 1000, K 1024, MB 1000*1000, M 1024*1024,\n\
 GB 1000*1000*1000, G 1024*1024*1024, and so on for T, P, E, Z, Y.\n\
 \n\
-- 
2.1.4






reply via email to

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