diff options
author | Eric Blake <ebb9@byu.net> | 2009-05-20 06:32:10 -0600 |
---|---|---|
committer | Eric Blake <ebb9@byu.net> | 2009-05-29 16:14:56 -0600 |
commit | c43333419bad3408529bb356cd167f91b6d4f6b2 (patch) | |
tree | c37136333340a0af296b9944711a8a9561b7e5d5 | |
parent | 159faba1376ffd5a46fe4bbc780d85dd3e502cea (diff) | |
download | coreutils-c43333419bad3408529bb356cd167f91b6d4f6b2.tar.xz |
head, tail: make --help less ambiguous
* src/head.c (usage): Use -n K, not -n N, to avoid confusion.
* src/tail.c (usage): Likewise.
* doc/coreutils.texi (head invocation, tail invocation):
Likewise.
Reported by Christophe Lyon.
-rw-r--r-- | doc/coreutils.texi | 44 | ||||
-rw-r--r-- | src/head.c | 13 | ||||
-rw-r--r-- | src/tail.c | 17 |
3 files changed, 38 insertions, 36 deletions
diff --git a/doc/coreutils.texi b/doc/coreutils.texi index 834bd462c..155858b54 100644 --- a/doc/coreutils.texi +++ b/doc/coreutils.texi @@ -2653,22 +2653,22 @@ The program accepts the following options. Also see @ref{Common options}. @table @samp -@item -c @var{n} -@itemx --bytes=@var{n} +@item -c @var{k} +@itemx --bytes=@var{k} @opindex -c @opindex --bytes -Print the first @var{n} bytes, instead of initial lines. -However, if @var{n} starts with a @samp{-}, -print all but the last @var{n} bytes of each file. -@multiplierSuffixes{n} +Print the first @var{k} bytes, instead of initial lines. +However, if @var{k} starts with a @samp{-}, +print all but the last @var{k} bytes of each file. +@multiplierSuffixes{k} -@itemx -n @var{n} -@itemx --lines=@var{n} +@itemx -n @var{k} +@itemx --lines=@var{k} @opindex -n @opindex --lines -Output the first @var{n} lines. -However, if @var{n} starts with a @samp{-}, -print all but the last @var{n} lines of each file. +Output the first @var{k} lines. +However, if @var{k} starts with a @samp{-}, +print all but the last @var{k} lines of each file. Size multiplier suffixes are the same as with the @option{-c} option. @item -q @@ -2738,14 +2738,14 @@ The program accepts the following options. Also see @ref{Common options}. @table @samp -@item -c @var{n} -@itemx --bytes=@var{n} +@item -c @var{k} +@itemx --bytes=@var{k} @opindex -c @opindex --bytes -Output the last @var{n} bytes, instead of final lines. -However, if @var{n} starts with a @samp{+}, start printing with the -@var{n}th byte from the start of each file, instead of from the end. -@multiplierSuffixes{n} +Output the last @var{k} bytes, instead of final lines. +However, if @var{k} starts with a @samp{+}, start printing with the +@var{k}th byte from the start of each file, instead of from the end. +@multiplierSuffixes{k} @item -f @itemx --follow[=@var{how}] @@ -2850,13 +2850,13 @@ number of seconds between when tail prints the last pre-rotation lines and when it prints the lines that have accumulated in the new log file. This option is meaningful only when following by name. -@itemx -n @var{n} -@itemx --lines=@var{n} +@itemx -n @var{k} +@itemx --lines=@var{k} @opindex -n @opindex --lines -Output the last @var{n} lines. -However, if @var{n} starts with a @samp{+}, start printing with the -@var{n}th line from the start of each file, instead of from the end. +Output the last @var{k} lines. +However, if @var{k} starts with a @samp{+}, start printing with the +@var{k}th line from the start of each file, instead of from the end. Size multiplier suffixes are the same as with the @option{-c} option. @item -q diff --git a/src/head.c b/src/head.c index 7f90d4b29..c96f91009 100644 --- a/src/head.c +++ b/src/head.c @@ -1,5 +1,6 @@ /* head -- output first part of file(s) - Copyright (C) 89, 90, 91, 1995-2006, 2008 Free Software Foundation, Inc. + Copyright (C) 89, 90, 91, 1995-2006, 2008-2009 Free Software + Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -118,12 +119,12 @@ With no FILE, or when FILE is -, read standard input.\n\ Mandatory arguments to long options are mandatory for short options too.\n\ "), stdout); fputs (_("\ - -c, --bytes=[-]N print the first N bytes of each file;\n\ + -c, --bytes=[-]K print the first K bytes of each file;\n\ with the leading `-', print all but the last\n\ - N bytes of each file\n\ - -n, --lines=[-]N print the first N lines instead of the first 10;\n\ + K bytes of each file\n\ + -n, --lines=[-]K print the first K lines instead of the first 10;\n\ with the leading `-', print all but the last\n\ - N lines of each file\n\ + K lines of each file\n\ "), stdout); fputs (_("\ -q, --quiet, --silent never print headers giving file names\n\ @@ -133,7 +134,7 @@ Mandatory arguments to long options are mandatory for short options too.\n\ fputs (VERSION_OPTION_DESCRIPTION, stdout); fputs (_("\ \n\ -N may have a multiplier suffix:\n\ +K 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 fe3460054..9d416e114 100644 --- a/src/tail.c +++ b/src/tail.c @@ -1,5 +1,6 @@ /* tail -- output the last part of file(s) - Copyright (C) 1989, 90, 91, 1995-2006, 2008 Free Software Foundation, Inc. + Copyright (C) 1989, 90, 91, 1995-2006, 2008-2009 Free Software + Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -226,8 +227,8 @@ With no FILE, or when FILE is -, read standard input.\n\ Mandatory arguments to long options are mandatory for short options too.\n\ "), stdout); fputs (_("\ - -c, --bytes=N output the last N bytes; alternatively, use +N to\n\ - output bytes starting with the Nth of each file\n\ + -c, --bytes=K output the last K bytes; alternatively, use +K to\n\ + output bytes starting with the Kth of each file\n\ "), stdout); fputs (_("\ -f, --follow[={name|descriptor}]\n\ @@ -237,8 +238,8 @@ Mandatory arguments to long options are mandatory for short options too.\n\ -F same as --follow=name --retry\n\ "), stdout); printf (_("\ - -n, --lines=N output the last N lines, instead of the last %d;\n\ - or use +N to output lines starting with the Nth\n\ + -n, --lines=K output the last K lines, instead of the last %d;\n\ + or use +K to output lines starting with the Kth\n\ --max-unchanged-stats=N\n\ with --follow=name, reopen a FILE which has not\n\ changed size after N (default %d) iterations\n\ @@ -264,9 +265,9 @@ Mandatory arguments to long options are mandatory for short options too.\n\ fputs (VERSION_OPTION_DESCRIPTION, stdout); fputs (_("\ \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\ +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\ 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\ |