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
|
Rev | Line | |
---|
[9] | 1 | open Logarion
|
---|
| 2 |
|
---|
[66] | 3 | open Cmdliner
|
---|
| 4 |
|
---|
| 5 |
|
---|
| 6 | let id = Arg.(value & pos 0 string "" & info [] ~docv:"text ID")
|
---|
| 7 | let recurse = Arg.(value & flag & info ["R"] ~doc:"recurse, include subdirs")
|
---|
| 8 | let reverse = Arg.(value & flag & info ["r"] ~doc:"reverse order")
|
---|
| 9 | let time = Arg.(value & flag & info ["t"] ~doc:"sort by time, newest first")
|
---|
| 10 | let number = Arg.(value & opt (some int) None & info ["n"] ~docv:"number" ~doc:"number of entries to list")
|
---|
| 11 | let authed = Arg.(value & opt (some string) None & info ["authored"] ~docv:"comma-separated names" ~doc:"texts by authors")
|
---|
| 12 | let topics = Arg.(value & opt (some string) None & info ["topics"] ~docv:"comma-separated topics" ~doc:"texts with topics")
|
---|
| 13 |
|
---|
| 14 | let read_t = Term.(const (Archive.apply_sys_util "PAGER" "less") $ recurse $ time $ reverse $ number $ authed $ topics $ id)
|
---|
| 15 |
|
---|
| 16 | let 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.