From 681c9e3a618a6834aa778102d8f4fd201d488244 Mon Sep 17 00:00:00 2001 From: Marc Coquand Date: Sun, 30 Jun 2024 17:23:27 -0500 Subject: Bug fixes --- lib/grep.ml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'lib/grep.ml') 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 -- cgit v1.2.3