From 1bdb767851d10acc9bf5b9306b7cc62cadbfe121 Mon Sep 17 00:00:00 2001 From: Mikko Vedru Date: Sat, 23 Nov 2019 19:09:15 +0200 Subject: [PATCH] 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 --- src/app.rs | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/src/app.rs b/src/app.rs index ae26f0c6..4e0ccfc4 100644 --- a/src/app.rs +++ b/src/app.rs @@ -2308,16 +2308,15 @@ fn flag_sort(args: &mut Vec) { This flag enables sorting of results in ascending order. The possible values for this flag are: - path Sort by file path. - modified Sort by the last modified time on a file. - accessed Sort by the last accessed time on a file. - created Sort by the creation time on a file. - none Do not sort results. + none (Default) Do not sort results. Fastest. Can be multi-threaded. + path Sort by file path. Always single-threaded. + modified Sort by the last modified time on a file. Always single-threaded. + accessed Sort by the last accessed time on a file. Always single-threaded. + 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 -time is not available on ext4 file systems), then ripgrep will attempt to -detect this and print an error without searching any results. Otherwise, the -sort order is unspecified. +If the chosen (manually or by-default) sorting criteria isn't available on your +system (for example, creation time is not available on ext4 file systems), then +ripgrep will attempt to detect this, print an error and exit without searching. To sort results in reverse or descending order, use the --sortr flag. Also, this flag overrides --sortr. @@ -2341,16 +2340,15 @@ fn flag_sortr(args: &mut Vec) { This flag enables sorting of results in descending order. The possible values for this flag are: - path Sort by file path. - modified Sort by the last modified time on a file. - accessed Sort by the last accessed time on a file. - created Sort by the creation time on a file. - none Do not sort results. + none (Default) Do not sort results. Fastest. Can be multi-threaded. + path Sort by file path. Always single-threaded. + modified Sort by the last modified time on a file. Always single-threaded. + accessed Sort by the last accessed time on a file. Always single-threaded. + 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 -time is not available on ext4 file systems), then ripgrep will attempt to -detect this and print an error without searching any results. Otherwise, the -sort order is unspecified. +If the chosen (manually or by-default) sorting criteria isn't available on your +system (for example, creation time is not available on ext4 file systems), then +ripgrep will attempt to detect this, print an error and exit without searching. To sort results in ascending order, use the --sort flag. Also, this flag overrides --sort.