aboutsummaryrefslogtreecommitdiff
path: root/lib/grep.ml
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--lib/grep.ml14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/grep.ml b/lib/grep.ml
index f672d01..a801fd7 100644
--- a/lib/grep.ml
+++ b/lib/grep.ml
@@ -256,6 +256,20 @@ let parse_full_content files =
files
+let get_file_names tag =
+ let cmd =
+ let open Shexp_process in
+ let open Shexp_process.Infix in
+ find_sort_name ()
+ |- call [ "xargs"; grep_cmd; "-H"; "-r"; "-l"; "--no-messages"; "-E"; tag ]
+ |- call [ "sort"; "-n"; "-r" ]
+ |- read_all
+ in
+ Shexp_process.eval (Shexp_process.chdir execution_directory cmd)
+ |> String.split_on_char '\n'
+ |> List.filter (fun s -> not (String.equal "" s))
+
+
type display_type =
| Bold of string
| Normal of string