Migrate the codebase to the latest revision of Cmdliner

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

git-svn-id: file:///srv/svn/repo/kosuzu/trunk@66 eb64cd80-c68d-6f47-b6a3-0ada418499da
This commit is contained in:
yakumo.izuru
2024-08-21 01:37:05 +00:00
parent 3f090772ce
commit d310d041ce
17 changed files with 271 additions and 233 deletions

View File

@@ -6,12 +6,17 @@ let authors r topics_opt =
let s = File_store.fold ~r ~predicate author_union Person.Set.empty in
Person.Set.iter (fun x -> print_endline (Person.to_string x)) s
open Ocmd
let term =
let recurse = Arg.(value & flag & info ["R"]
~doc:"include texts in subdirectories too") in
let topics = Arg.(value & opt (some string) None & info ["topics"]
~docv:"TOPICS" ~doc:"display authors who have written on topics") in
Term.(const authors $ recurse $ topics),
Term.info "authors" ~doc:"list authors"
~man:[ `S "DESCRIPTION"; `P "List author names" ]
open Cmdliner
let recurse = Arg.(value & flag & info ["R"] ~doc: "Include texts in subdirectories too")
let topics = Arg.(value & opt (some string) None & info ["topics"] ~docv:"topics" ~doc: "Display authors who have written on topics")
let authors_t = Term.(const authors $ recurse $ topics)
let cmd =
let doc = "List authors" in
let man = [
`S Manpage.s_description;
`P "List author names" ]
in
let info = Cmd.info "authors" ~version:"%%VERSION%%" ~doc ~man in
Cmd.v info authors_t