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:
@@ -6,12 +6,16 @@ let topics r authors_opt =
|
||||
let s = File_store.fold ~r ~predicate topic_union String_set.empty in
|
||||
print_endline @@ String_set.to_string s
|
||||
|
||||
open Ocmd
|
||||
let term =
|
||||
let recurse = Arg.(value & flag & info ["R"]
|
||||
~doc:"include texts in subdirectories") in
|
||||
let authed = Arg.(value & opt (some string) None & info ["authored"]
|
||||
~docv:"comma-separated authors" ~doc:"topics by authors") in
|
||||
Term.(const topics $ recurse $ authed),
|
||||
Term.info "topics" ~doc:"list topics" ~man:[ `S "DESCRIPTION";
|
||||
`P "List of topics" ]
|
||||
open Cmdliner
|
||||
let recurse = Arg.(value & flag & info ["R"] ~doc: "Include texts in subdirectories")
|
||||
let authed = Arg.(value & opt (some string) None & info ["authored"] ~docv: "Comma-separated authors" ~doc: "Topics by authors")
|
||||
let topics_t = Term.(const topics $ recurse $ authed)
|
||||
|
||||
let cmd =
|
||||
let doc = "List topics" in
|
||||
let man = [
|
||||
`S Manpage.s_description;
|
||||
`P "List of topics" ]
|
||||
in
|
||||
let info = Cmd.info "topics" ~version:"%%VERSION%%" ~doc ~man in
|
||||
Cmd.v info topics_t
|
||||
|
||||
Reference in New Issue
Block a user