source: code/trunk/cli/read.ml@ 66

Last change on this file since 66 was 66, checked in by yakumo.izuru, 8 months ago

Migrate the codebase to the latest revision of Cmdliner

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

File size: 1.1 KB
RevLine 
[9]1open Logarion
2
[66]3open Cmdliner
4
5
6let id = Arg.(value & pos 0 string "" & info [] ~docv:"text ID")
7let recurse = Arg.(value & flag & info ["R"] ~doc:"recurse, include subdirs")
8let reverse = Arg.(value & flag & info ["r"] ~doc:"reverse order")
9let time = Arg.(value & flag & info ["t"] ~doc:"sort by time, newest first")
10let number = Arg.(value & opt (some int) None & info ["n"] ~docv:"number" ~doc:"number of entries to list")
11let authed = Arg.(value & opt (some string) None & info ["authored"] ~docv:"comma-separated names" ~doc:"texts by authors")
12let topics = Arg.(value & opt (some string) None & info ["topics"] ~docv:"comma-separated topics" ~doc:"texts with topics")
13
14let read_t = Term.(const (Archive.apply_sys_util "PAGER" "less") $ recurse $ time $ reverse $ number $ authed $ topics $ id)
15
16let cmd =
17 let doc = "Read a text" in
18 let man = [
19 `S Manpage.s_description;
20 `P "Deprecated. This subcommand will be removed in a future release of Logarion";
21 `P "This invokes the PAGER utility ('less' if unset) on an article of the archive" ]
22 in
23 let info = Cmd.info "read" ~version:"%%VERSION%%" ~doc ~man in
24 Cmd.v info read_t
Note: See TracBrowser for help on using the repository browser.