diff options
Diffstat (limited to 'lib/grep.ml')
-rw-r--r-- | lib/grep.ml | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/grep.ml b/lib/grep.ml index 6ed2a98..0e8294a 100644 --- a/lib/grep.ml +++ b/lib/grep.ml @@ -52,6 +52,14 @@ let pad str n = exception Not_A_Tuple of string * string (* todo parsing *) +let done_get_args = [ grep_cmd; done_pattern_regexp; "-H"; "-r"; "-n"; "--no-messages" ] + +let get_done () = + let open Shexp_process in + let open Shexp_process.Infix in + run_calls (call done_get_args |- call [ "sort"; "-n"; "-r" ]) + + let todo_get_args = [ grep_cmd; todo_pattern_regexp; "-H"; "-r"; "-n"; "--no-messages" ] let get_todos () = @@ -158,6 +166,8 @@ let get_tagged_headlines tag () = (find_sort_name () |- call headline_args |- call [ grep_cmd; "--no-messages"; "-E"; tag ] + |- call filter_todos_args + |- call filter_done_args |- call [ "sort"; "-n"; "-r" ] |- read_all)) @@ -231,6 +241,6 @@ let pretty_print_parsed_content parsed_files = List.concat_map (fun (file_name, line_number, line_content, _) -> if line_number == 0 - then [ Bold ("------- " ^ file_name); Normal line_content ] + then [ Bold ("--------- " ^ file_name); Normal line_content ] else [ Normal (padding ^ line_content) ]) parsed_files |