From 613b17e9f30b4def18e014993576a4324d9b11a4 Mon Sep 17 00:00:00 2001 From: Marc Coquand Date: Wed, 15 May 2024 14:18:05 -0500 Subject: Add regexp search for done and todo --- lib/grep.ml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'lib/grep.ml') diff --git a/lib/grep.ml b/lib/grep.ml index 0e8294a..f672d01 100644 --- a/lib/grep.ml +++ b/lib/grep.ml @@ -99,6 +99,30 @@ let pretty_format_todo parsed_headlines = parsed_headlines +let get_tagged_done tag () = + let open Shexp_process in + let open Shexp_process.Infix in + eval + (chdir + execution_directory + (call done_get_args + |- call [ grep_cmd; "--no-messages"; "-E"; tag ] + |- call [ "sort"; "-n"; "-r" ] + |- read_all)) + + +let get_tagged_todo tag () = + let open Shexp_process in + let open Shexp_process.Infix in + eval + (chdir + execution_directory + (call todo_get_args + |- call [ grep_cmd; "--no-messages"; "-E"; tag ] + |- call [ "sort"; "-n"; "-r" ] + |- read_all)) + + let toggle_done file_name = let open Shexp_process in run_calls -- cgit v1.2.3