Last change
on this file since 65 was 65, checked in by yakumo.izuru, 8 months ago |
Replace Cmdliner with Ocmd, re-add documentation
Signed-off-by: Izuru Yakumo <yakumo.izuru@…>
|
File size:
775 bytes
|
Line | |
---|
1 | open Logarion
|
---|
2 | let 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 |
|
---|
9 | open Ocmd
|
---|
10 | let term =
|
---|
11 | let recurse = Arg.(value & flag & info ["R"]
|
---|
12 | ~doc:"include texts in subdirectories too") in
|
---|
13 | let topics = Arg.(value & opt (some string) None & info ["topics"]
|
---|
14 | ~docv:"TOPICS" ~doc:"display authors who have written on topics") in
|
---|
15 | Term.(const authors $ recurse $ topics),
|
---|
16 | Term.info "authors" ~doc:"list authors"
|
---|
17 | ~man:[ `S "DESCRIPTION"; `P "List author names" ]
|
---|
Note:
See
TracBrowser
for help on using the repository browser.