From 40e310a9f9e21929acb5b0eb364ffad51df80608 Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Sat, 25 Aug 2018 22:53:27 -0400 Subject: 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 --- complete/_rg | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'complete/_rg') 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]' -- cgit v1.2.3