source: code/trunk/cli/authors.ml@ 69

Last change on this file since 69 was 69, checked in by Izuru Yakumo, 8 months ago

txt new no longer sets default titles, remove %%VERSION%% from all subcommands (as they're pulled from txt.ml)

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

File size: 871 bytes
Line 
1open Logarion
2let authors r topics_opt =
3 let predicates = Archive.(predicate topics topics_opt) in
4 let predicate text = List.fold_left (fun a e -> a && e text) true predicates in
5 let author_union a (e, _) = Person.Set.union a e.Text.authors in
6 let s = File_store.fold ~r ~predicate author_union Person.Set.empty in
7 Person.Set.iter (fun x -> print_endline (Person.to_string x)) s
8
9open Cmdliner
10let recurse = Arg.(value & flag & info ["R"] ~doc: "Include texts in subdirectories too")
11let topics = Arg.(value & opt (some string) None & info ["topics"] ~docv:"topics" ~doc: "Display authors who have written on topics")
12
13let authors_t = Term.(const authors $ recurse $ topics)
14
15let cmd =
16 let doc = "List authors" in
17 let man = [
18 `S Manpage.s_description;
19 `P "List author names" ]
20 in
21 let info = Cmd.info "authors" ~doc ~man in
22 Cmd.v info authors_t
Note: See TracBrowser for help on using the repository browser.