Changeset 66 in code for trunk/cli/read.ml
- Timestamp:
- Aug 21, 2024, 1:37:05 AM (8 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cli/read.ml
r65 r66 1 1 open Logarion 2 2 3 open Ocmd 4 let term = 5 let id = Arg.(value & pos 0 string "" & info [] ~docv:"text ID") in 6 let recurse = Arg.(value & flag & info ["R"] ~doc:"recurse, include subdirs") in 7 let reverse = Arg.(value & flag & info ["r"] ~doc:"reverse order") in 8 let time = Arg.(value & flag & info ["t"] ~doc:"sort by time, newest first") in 9 let number = Arg.(value & opt (some int) None & info ["n"] 10 ~docv:"number" ~doc:"number of entries to list") in 11 let authed = Arg.(value & opt (some string) None & info ["authored"] 12 ~docv:"comma-separated names" ~doc:"texts by authors") in 13 let topics = Arg.(value & opt (some string) None & info ["topics"] 14 ~docv:"comma-separated topics" ~doc:"texts with topics") in 15 Term.(const (Archive.apply_sys_util "PAGER" "less") $ recurse $ time $ reverse $ number $ authed $ topics $ id), 16 Term.info "read" ~doc: "read a text" ~man:[ `S "DESCRIPTION"; 17 `P "List header information for current directory. If -R is used, list header 18 information for texts found in subdirectories too, along with their filepaths" ] 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 TracChangeset
for help on using the changeset viewer.