Use pipes to separate fields on the listing subcommand

Signed-off-by: Izuru Yakumo <yakumo.izuru@chaotic.ninja>

git-svn-id: file:///srv/svn/repo/kosuzu/trunk@53 eb64cd80-c68d-6f47-b6a3-0ada418499da
This commit is contained in:
yakumo.izuru 2023-10-21 00:41:04 +00:00
parent 51ac2486d4
commit 1592652595

View File

@ -6,7 +6,7 @@ let listing r order_opt reverse_opt number_opt paths_opt authors_opt topics_opt
let dir = if dir = "" then FS.txtdir () else dir in
let predicates = A.predicate A.authored authors_opt @ A.predicate A.topics topics_opt in
let predicate text = List.fold_left (fun a e -> a && e text) true predicates in
let list_text (t, fnames) = Printf.printf "%s %s %s 𐄁 %s%s\n"
let list_text (t, fnames) = Printf.printf "%s | %s | %s | %s %s\n"
(Text.short_id t) Date.(pretty_date @@ listing t.Text.date)
(Person.Set.to_string ~names_only:true t.Text.authors)
t.Text.title (if paths_opt then (List.fold_left (Printf.sprintf "%s\n@ %s") "" fnames) else "")