* doc/coreutils.texi (sort invocation): Reorder the options
alphabetically.
* src/sort.c (usage): Likewise.
---
doc/coreutils.texi | 77 +++++++++++++++++++++++-----------------------
src/sort.c | 17 +++++-----
2 files changed, 48 insertions(+), 46 deletions(-)
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index ac691e7ba..477d8f96b 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -4781,6 +4781,32 @@ Other options are:
@table @samp
+@optItem{sort,--batch-size,=@var{nmerge}}
+@cindex number of inputs to merge, nmerge
+Merge at most @var{nmerge} inputs at once.
+
+When @command{sort} has to merge more than @var{nmerge} inputs,
+it merges them in groups of @var{nmerge}, saving the result in
+a temporary file, which is then used as an input in a subsequent merge.
+
+A large value of @var{nmerge} may improve merge performance and decrease
+temporary storage utilization at the expense of increased memory usage
+and I/O@. Conversely a small value of @var{nmerge} may reduce memory
+requirements and I/O at the expense of temporary storage consumption and
+merge performance.
+
+The value of @var{nmerge} must be at least 2. The default value is
+currently 16, but this is implementation-dependent and may change in
+the future.
+
+The value of @var{nmerge} may be bounded by a resource limit for open
+file descriptors. The commands @samp{ulimit -n} or @samp{getconf
+OPEN_MAX} may display limits for your systems; these limits may be
+modified further if your program already has some files open, or if
+the operating system has other limits on the number of open files. If
+the value of @var{nmerge} exceeds the resource limit, @command{sort}
+silently uses a smaller value.
+
@optItem{sort,--compress-program,@w{ }@var{prog}}
Compress any temporary files with the program @var{prog}.
@@ -4797,6 +4823,10 @@ files.
White space and the backslash character should not appear in
@var{prog}; they are reserved for future use.
+@optItem{sort,--debug,}
+Highlight the portion of each line used for sorting.
+Also issue warnings about questionable usage to standard error.
+
@filesZeroFromOption{sort,,sorted output}
@optItem{sort,-k,@w{ }@var{pos1}[@comma{}@var{pos2}]}
@@ -4829,36 +4859,6 @@ Example: To sort on the second field, use
@option{--key=2,2}
See also the @option{--debug} option to help determine the part
of the line being used in the sort.
-@optItem{sort,--debug,}
-Highlight the portion of each line used for sorting.
-Also issue warnings about questionable usage to standard error.
-
-@optItem{sort,--batch-size,=@var{nmerge}}
-@cindex number of inputs to merge, nmerge
-Merge at most @var{nmerge} inputs at once.
-
-When @command{sort} has to merge more than @var{nmerge} inputs,
-it merges them in groups of @var{nmerge}, saving the result in
-a temporary file, which is then used as an input in a subsequent merge.
-
-A large value of @var{nmerge} may improve merge performance and decrease
-temporary storage utilization at the expense of increased memory usage
-and I/O@. Conversely a small value of @var{nmerge} may reduce memory
-requirements and I/O at the expense of temporary storage consumption and
-merge performance.
-
-The value of @var{nmerge} must be at least 2. The default value is
-currently 16, but this is implementation-dependent and may change in
-the future.
-
-The value of @var{nmerge} may be bounded by a resource limit for open
-file descriptors. The commands @samp{ulimit -n} or @samp{getconf
-OPEN_MAX} may display limits for your systems; these limits may be
-modified further if your program already has some files open, or if
-the operating system has other limits on the number of open files. If
-the value of @var{nmerge} exceeds the resource limit, @command{sort}
-silently uses a smaller value.
-
@optItem{sort,-o,@w{ }@var{output-file}}
@optItemx{sort,--output,=@var{output-file}}
@cindex overwriting of input, allowed
@@ -4880,6 +4880,15 @@ On newer systems, @option{-o} cannot appear after an
input file if
scripts should specify @option{-o @var{output-file}} before any input
files.
+@optItem{sort,--parallel,=@var{n}}
+@cindex multithreaded sort
+Set the number of sorts run in parallel to @var{n}. By default,
+i.e., without @option{--parallel} specified, @var{n} is set to
+the number of available processors, but limited to 8,
+as performance gains generally diminish after that.
+Using @var{n} threads increases the memory usage by a factor of log @var{n}.
+Also see @ref{nproc invocation}.
+
@optItem{sort,--random-source,=@var{file}}
@cindex random source for sorting
Use @var{file} as a source of random data used to determine which
@@ -4946,14 +4955,6 @@ have a large sort or merge that is I/O-bound, you can
often improve
performance by using this option to specify directories on different
file systems.
-@optItem{sort,--parallel,=@var{n}}
-@cindex multithreaded sort
-Set the number of sorts run in parallel to @var{n}. By default,
-@var{n} is set to the number of available processors, but limited
-to 8, as performance gains diminish after that.
-Using @var{n} threads increases the memory usage by
-a factor of log @var{n}. Also see @ref{nproc invocation}.
-
@optItem{sort,-u,}
@optItemx{sort,--unique,}
@cindex uniquifying output
diff --git a/src/sort.c b/src/sort.c
index 398ca149d..d687e27aa 100644
--- a/src/sort.c
+++ b/src/sort.c
@@ -448,6 +448,7 @@ Write sorted concatenation of all FILE(s) to standard
output.\n\
emit_mandatory_arg_note ();
fputs (_("\
+\n\
Ordering options:\n\
\n\
"), stdout);
@@ -466,6 +467,10 @@ Ordering options:\n\
oputs (_("\
-g, --general-numeric-sort\n\
compare according to general numerical value\n\
+"));
+ oputs (_("\
+ -h, --human-numeric-sort\n\
+ compare human readable numbers (e.g., 2K 1G)\n\
"));
oputs (_("\
-i, --ignore-nonprinting\n\
@@ -474,10 +479,6 @@ Ordering options:\n\
oputs (_("\
-M, --month-sort\n\
compare (unknown) < 'JAN' < ... < 'DEC'\n\
-"));
- oputs (_("\
- -h, --human-numeric-sort\n\
- compare human readable numbers (e.g., 2K 1G)\n\
"));
oputs (_("\
-n, --numeric-sort\n\
@@ -549,6 +550,10 @@ Other options:\n\
oputs (_("\
-o, --output=FILE\n\
write result to FILE instead of standard output\n\
+"));
+ oputs (_("\
+ --parallel=N\n\
+ change the number of sorts run concurrently to N\n\
"));
oputs (_("\
-s, --stable\n\
@@ -568,10 +573,6 @@ Other options:\n\
multiple options specify multiple directories\n\
"), DEFAULT_TMPDIR);
oputs (_("\
- --parallel=N\n\
- change the number of sorts run concurrently to N\n\
-"));
- oputs (_("\
-u, --unique\n\
output only the first of lines with equal keys;\n\
with -c, check for strict ordering\n\
--
2.56.0