doc: improve docs for --sort and --sortr flags

I improved the help documentation in the following manner and for the
following reasons:

1. It's only logical to put the default sub-option on the first possible
line, as well as to separately mention that it is indeed the default
sub-option.

2. Additional options for the flags should describe the main points of
their purpose without requiring user to read the whole help entry. In my
opinion, the information sub-options' influence on multi-threading and
speed are important enough to warrant their inclusion in each
sub-option's description line text.

Closes #1434
This commit is contained in:
Mikko Vedru 2019-11-23 19:09:15 +02:00 committed by Andrew Gallant
parent a4897eca23
commit 1bdb767851

View File

@ -2308,16 +2308,15 @@ fn flag_sort(args: &mut Vec<RGArg>) {
This flag enables sorting of results in ascending order. The possible values This flag enables sorting of results in ascending order. The possible values
for this flag are: for this flag are:
path Sort by file path. none (Default) Do not sort results. Fastest. Can be multi-threaded.
modified Sort by the last modified time on a file. path Sort by file path. Always single-threaded.
accessed Sort by the last accessed time on a file. modified Sort by the last modified time on a file. Always single-threaded.
created Sort by the creation time on a file. accessed Sort by the last accessed time on a file. Always single-threaded.
none Do not sort results. created Sort by the creation time on a file. Always single-threaded.
If the sorting criteria isn't available on your system (for example, creation If the chosen (manually or by-default) sorting criteria isn't available on your
time is not available on ext4 file systems), then ripgrep will attempt to system (for example, creation time is not available on ext4 file systems), then
detect this and print an error without searching any results. Otherwise, the ripgrep will attempt to detect this, print an error and exit without searching.
sort order is unspecified.
To sort results in reverse or descending order, use the --sortr flag. Also, To sort results in reverse or descending order, use the --sortr flag. Also,
this flag overrides --sortr. this flag overrides --sortr.
@ -2341,16 +2340,15 @@ fn flag_sortr(args: &mut Vec<RGArg>) {
This flag enables sorting of results in descending order. The possible values This flag enables sorting of results in descending order. The possible values
for this flag are: for this flag are:
path Sort by file path. none (Default) Do not sort results. Fastest. Can be multi-threaded.
modified Sort by the last modified time on a file. path Sort by file path. Always single-threaded.
accessed Sort by the last accessed time on a file. modified Sort by the last modified time on a file. Always single-threaded.
created Sort by the creation time on a file. accessed Sort by the last accessed time on a file. Always single-threaded.
none Do not sort results. created Sort by the creation time on a file. Always single-threaded.
If the sorting criteria isn't available on your system (for example, creation If the chosen (manually or by-default) sorting criteria isn't available on your
time is not available on ext4 file systems), then ripgrep will attempt to system (for example, creation time is not available on ext4 file systems), then
detect this and print an error without searching any results. Otherwise, the ripgrep will attempt to detect this, print an error and exit without searching.
sort order is unspecified.
To sort results in ascending order, use the --sort flag. Also, this flag To sort results in ascending order, use the --sort flag. Also, this flag
overrides --sort. overrides --sort.