source: code/trunk/cli/recent.ml@ 72

Last change on this file since 72 was 69, checked in by Izuru Yakumo, 8 months ago

txt new no longer sets default titles, remove %%VERSION%% from all subcommands (as they're pulled from txt.ml)

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

File size: 1.2 KB
Line 
1open Logarion
2module FS = File_store
3module A = Archive
4
5open Cmdliner
6let recurse = Arg.(value & flag & info ["R"] ~doc: "Recurse into subdirectories")
7let reverse = Arg.(value & flag & info ["r"] ~doc: "Reverse order")
8let paths = Arg.(value & flag & info ["p"] ~doc: "Show file paths")
9let number = Arg.(value & opt (some int) (Some 10) & info ["n"] ~docv: "number" ~doc: "Number of entries to list")
10let authed = Arg.(value & opt (some string) None & info ["authored"] ~docv: "Comma-separated names" ~doc: "Texts by authors")
11let topics = Arg.(value & opt (some string) None & info ["topics"] ~docv: "Comma-separated topics" ~doc: "Texts with topics")
12let dir = Arg.(value & pos 0 string "" & info [] ~docv: "Directory to index")
13
14let recent_t = Term.(const Listing.listing $ recurse $ (const true) $ reverse $ number $ paths $ authed $ topics $ dir)
15let cmd =
16 let doc = "List recent texts" in
17 let man = [
18 `S Manpage.s_description;
19 `P "List header information of most recent texts.";
20 `P "If -R is used, list header information for texts found in subdirectories, too, along with their filepaths" ]
21 in
22 let info = Cmd.info "recent" ~doc ~man in
23 Cmd.v info recent_t
Note: See TracBrowser for help on using the repository browser.