From f7ab20cd606fe6f66028a382d1b5736c4fea9d15 Mon Sep 17 00:00:00 2001 From: Bernhard Voelker Date: Mon, 30 Nov 2015 22:09:29 +0100 Subject: 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 NUM instead. * doc/coreutils.texi (head invocation): Replace @var{k} by @var{num}. Also change @var{count} in the paragraph about the obsolete option syntax. (tail invocation): Likewise. Furthermore, adjust the option order to alphabetical sorting. * src/head.c (usage): s/K/NUM/ in as placeholder in the -c and -n options. Furthermore, print the actual DEFAULT_NUMBER instead of the hard-coded 10. * src/tail.c (usage): s/K/NUM/ in as placeholder in the -c and -n options. Add "[+]" to clarify that NUM may optionally be preceded by this sign. Remove the redundant explanation of the optional '+' prefix for NUM, as that is now clear from the option description above. Suggested by Dan Jacobson in http://bugs.gnu.org/22042 --- src/head.c | 20 ++++++++++---------- src/tail.c | 12 +++++------- 2 files changed, 15 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/head.c b/src/head.c index e05c21935..448d89a6f 100644 --- a/src/head.c +++ b/src/head.c @@ -106,22 +106,22 @@ usage (int status) Usage: %s [OPTION]... [FILE]...\n\ "), program_name); - fputs (_("\ -Print the first 10 lines of each FILE to standard output.\n\ + printf (_("\ +Print the first %d lines of each FILE to standard output.\n\ With more than one FILE, precede each with a header giving the file name.\n\ -"), stdout); +"), DEFAULT_NUMBER); emit_stdin_note (); emit_mandatory_arg_note (); - fputs (_("\ - -c, --bytes=[-]K print the first K bytes of each file;\n\ + printf (_("\ + -c, --bytes=[-]NUM print the first NUM 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\ + NUM bytes of each file\n\ + -n, --lines=[-]NUM print the first NUM lines instead of the first %d;\n\ with the leading '-', print all but the last\n\ - K lines of each file\n\ -"), stdout); + NUM lines of each file\n\ +"), DEFAULT_NUMBER); fputs (_("\ -q, --quiet, --silent never print headers giving file names\n\ -v, --verbose always 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\ +NUM 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 223c8f839..0a515791f 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=[+]NUM output the last NUM bytes; or use -c +NUM to\n\ + output starting with byte NUM of each file\n\ "), stdout); fputs (_("\ -f, --follow[={name|descriptor}]\n\ @@ -273,8 +273,8 @@ 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\ + -n, --lines=[+]NUM output the last NUM lines, instead of the last %d;\n\ + or use -n +NUM to output starting with line NUM\n\ --max-unchanged-stats=N\n\ with --follow=name, reopen a FILE which has not\n\ changed size after N (default %d) iterations\n\ @@ -301,9 +301,7 @@ With more than one FILE, precede each with a header giving the file name.\n\ 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\ +NUM 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\ -- cgit v1.2.3-70-g09d2