diff options
author | Andrew Gallant <jamslam@gmail.com> | 2018-08-25 22:53:27 -0400 |
---|---|---|
committer | Andrew Gallant <jamslam@gmail.com> | 2018-08-26 18:42:25 -0400 |
commit | 40e310a9f9e21929acb5b0eb364ffad51df80608 (patch) | |
tree | ea3623dc04ea877e68aad37e09ef162b27781e9c /complete | |
parent | 510f15f4da46ca8553f93e9b82346794a6dc7dd9 (diff) |
ripgrep: add --sort and --sortr flags
These flags each accept one of five choices: none, path, modified,
accessed or created. The value indicates how the results are sorted.
For --sort, results are sorted in ascending order where as for --sortr,
results are sorted in descending order.
Closes #404
Diffstat (limited to 'complete')
-rw-r--r-- | complete/_rg | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/complete/_rg b/complete/_rg index 77f8394c..a3406471 100644 --- a/complete/_rg +++ b/complete/_rg @@ -188,8 +188,21 @@ _rg() { {-r+,--replace=}'[specify string used to replace matches]:replace string' + '(sort)' # File-sorting options - '(threads)--sort-files[sort results by file path (disables parallelism)]' - $no"--no-sort-files[don't sort results by file path]" + '(threads)--sort=[sort results in ascending order (disables parallelism)]:sort method:(( + none\:"no sorting" + path\:"sort by file path" + modified\:"sort by last modified time" + accessed\:"sort by last accessed time" + created\:"sort by creation time" + ))' + '(threads)--sortr=[sort results in descending order (disables parallelism)]:sort method:(( + none\:"no sorting" + path\:"sort by file path" + modified\:"sort by last modified time" + accessed\:"sort by last accessed time" + created\:"sort by creation time" + ))' + '!(threads)--sort-files[sort results by file path (disables parallelism)]' + '(stats)' # Statistics options '(--files file-match)--stats[show search statistics]' @@ -200,7 +213,7 @@ _rg() { $no"(--null-data)--no-text[don't search binary files as if they were text]" + '(threads)' # Thread-count options - '(--sort-files)'{-j+,--threads=}'[specify approximate number of threads to use]:number of threads' + '(sort)'{-j+,--threads=}'[specify approximate number of threads to use]:number of threads' + '(trim)' # Trim options '--trim[trim any ASCII whitespace prefix from each line]' |