Last change
on this file since 67 was 66, checked in by Izuru Yakumo, 8 months ago |
Migrate the codebase to the latest revision of Cmdliner
Signed-off-by: Izuru Yakumo <yakumo.izuru@…>
|
File size:
894 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 Cmdliner
|
---|
10 | let recurse = Arg.(value & flag & info ["R"] ~doc: "Include texts in subdirectories too")
|
---|
11 | let topics = Arg.(value & opt (some string) None & info ["topics"] ~docv:"topics" ~doc: "Display authors who have written on topics")
|
---|
12 |
|
---|
13 | let authors_t = Term.(const authors $ recurse $ topics)
|
---|
14 |
|
---|
15 | let 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" ~version:"%%VERSION%%" ~doc ~man in
|
---|
22 | Cmd.v info authors_t
|
---|
Note:
See
TracBrowser
for help on using the repository browser.