aboutsummaryrefslogtreecommitdiff
path: root/lib/grep.ml
diff options
context:
space:
mode:
Diffstat (limited to 'lib/grep.ml')
-rw-r--r--lib/grep.ml14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/grep.ml b/lib/grep.ml
index c5acbb6..94b4b48 100644
--- a/lib/grep.ml
+++ b/lib/grep.ml
@@ -94,10 +94,13 @@ let parse_todo_string s =
| _ -> raise (Not_A_Tuple (String.concat " SPLIT " split, message))))
-let pretty_format_todo parsed_headlines =
+let pretty_format_todo ?(hide_file_name = false) parsed_headlines =
let padding = get_padding_list parsed_headlines in
List.map
- (fun (file_name, content) -> String.concat " | " [ pad file_name padding; content ])
+ (fun (file_name, content) ->
+ if not hide_file_name
+ then String.concat " | " [ pad file_name padding; content ]
+ else content)
parsed_headlines
@@ -236,10 +239,13 @@ let parse_headlines s =
(** Turns "2024-03-05.org:* Hello world" into "2024-03-05 | * Hello world" *)
-let pretty_format parsed_headlines =
+let pretty_format ?(hide_file_name = false) parsed_headlines =
let padding = get_padding_arr parsed_headlines in
Array.map
- (fun (file_name, content) -> String.concat " | " [ pad file_name padding; content ])
+ (fun (file_name, content) ->
+ if not hide_file_name
+ then String.concat " | " [ pad file_name padding; content ]
+ else content)
parsed_headlines