On 2023-07-20 16:05, Pádraig Brady wrote:
On 19/07/2023 19:21, Dragan Simic wrote:
Clarify that the NUM values for head and tail are indices, and briefly
describe the specifics of +NUM for tail.

Signed-off-by: Dragan Simic <dsi...@manjaro.org>
---
  src/head.c | 3 ++-
  src/tail.c | 4 +++-
  2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/head.c b/src/head.c
index 7bba1420c..e82f9e195 100644
--- a/src/head.c
+++ b/src/head.c
@@ -137,7 +137,8 @@ With more than one FILE, precede each with a header giving the file name.\n\
        fputs (VERSION_OPTION_DESCRIPTION, stdout);
        fputs (_("\
  \n\
-NUM may have a multiplier suffix:\n\
+NUM values are indices, thus counting lines and bytes in a file starts\n\
+from one.  NUM may also 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, R, Q.\n\
  Binary prefixes can be used, too: KiB=K, MiB=M, and so on.\n\


Well only tail -n+NUM is an index,
whereas the other combinations would be most generally considered
as a count (to skip or include).
Also this doesn't specify if the index is 0 or 1 based.

In general, an index should count from one, while an offset counts from zero. However, there are no hard or "official" rules about an index counting strictly from one, so I agree, calling something an index could easily end up explaining it clearly to some people, while explaining exactly nothing to other people. Not good.

I'll apply the attached instead, which I think clarifies things.

Totally agreed, your version is very concise and leaves nothing to be questioned.

Reply via email to