diff options
Diffstat (limited to '')
-rw-r--r-- | lib/grep.ml | 10 |
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 |