aboutsummaryrefslogtreecommitdiff
path: root/lib/grep.ml
diff options
context:
space:
mode:
authorMarc Coquand <marc@mccd.space>2024-06-30 17:23:27 -0500
committerMarc Coquand <marc@mccd.space>2024-06-30 17:23:27 -0500
commit681c9e3a618a6834aa778102d8f4fd201d488244 (patch)
treeb0d3424ab2b1879f27d402ba1589e554da29dfab /lib/grep.ml
parent598ce9ecef91264bd78555bd5b6fcca97a073d95 (diff)
downloadstitch-681c9e3a618a6834aa778102d8f4fd201d488244.tar.gz
stitch-681c9e3a618a6834aa778102d8f4fd201d488244.tar.bz2
stitch-681c9e3a618a6834aa778102d8f4fd201d488244.zip
Bug fixesHEADmain
Diffstat (limited to 'lib/grep.ml')
-rw-r--r--lib/grep.ml10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/grep.ml b/lib/grep.ml
index b5bdbea..67e18b5 100644
--- a/lib/grep.ml
+++ b/lib/grep.ml
@@ -197,7 +197,7 @@ let get_headlines () =
let get_tagged_headlines tag () =
let open Shexp_process in
let open Shexp_process.Infix in
- try
+ let cmd () =
eval
(chdir
execution_directory
@@ -208,8 +208,10 @@ let get_tagged_headlines tag () =
|- call filter_done_args
|- call [ "sort"; "-n"; "-r" ]
|- read_all))
- with
- | _ -> ""
+ |> Option.some
+ in
+ try cmd () with
+ | _ -> None
let get_tags () =
@@ -233,7 +235,7 @@ let parse_headlines s =
match split with
(* file, line, content *)
| [ file_name; content ] -> Some (file_name, content)
- | _ -> raise (Not_A_Tuple (String.concat " SPLIT " split, message))))
+ | _ -> None))
|> Array.of_list