diff options
author | Marc Coquand <marc@mccd.space> | 2024-05-15 15:06:49 -0500 |
---|---|---|
committer | Marc Coquand <marc@mccd.space> | 2024-05-15 15:06:49 -0500 |
commit | fa2582d562118dc1ceccd01ede8d0d7e80d71a29 (patch) | |
tree | 21a54ab2f3e271bbb8e46cf60b830aedf0297c74 /lib/grep.ml | |
parent | 613b17e9f30b4def18e014993576a4324d9b11a4 (diff) | |
download | stitch-fa2582d562118dc1ceccd01ede8d0d7e80d71a29.tar.gz stitch-fa2582d562118dc1ceccd01ede8d0d7e80d71a29.tar.bz2 stitch-fa2582d562118dc1ceccd01ede8d0d7e80d71a29.zip |
Add basic file search
Diffstat (limited to 'lib/grep.ml')
-rw-r--r-- | lib/grep.ml | 14 |
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 |