New subcommand 'recent'. Tidy last.ml
git-svn-id: file:///srv/svn/repo/kosuzu/trunk@17 eb64cd80-c68d-6f47-b6a3-0ada418499da
This commit is contained in:
19
cli/recent.ml
Normal file
19
cli/recent.ml
Normal file
@@ -0,0 +1,19 @@
|
||||
open Logarion
|
||||
module FS = File_store
|
||||
module A = Archive
|
||||
|
||||
open Cmdliner
|
||||
let term =
|
||||
let recurse = Arg.(value & flag & info ["R"] ~doc:"recurse, include subdirs") in
|
||||
let reverse = Arg.(value & flag & info ["r"] ~doc:"reverse order") in
|
||||
let paths = Arg.(value & flag & info ["p"] ~doc:"show file paths") in
|
||||
let number = Arg.(value & opt (some int) (Some 10) & info ["n"]
|
||||
~docv:"number" ~doc:"number of entries to list") in
|
||||
let authed = Arg.(value & opt (some string) None & info ["authored"]
|
||||
~docv:"comma-separated names" ~doc:"texts by authors") in
|
||||
let topics = Arg.(value & opt (some string) None & info ["topics"]
|
||||
~docv:"comma-separated topics" ~doc:"texts with topics") in
|
||||
Term.(const Listing.listing $ recurse $ (const true) $ reverse $ number $ paths $ authed $ topics),
|
||||
Term.info "recent" ~doc:"list recent texts" ~man:[ `S "DESCRIPTION";
|
||||
`P "List header information of most recent texts. If -R is used, list header
|
||||
information for texts found in subdirectories too, along with their filepaths" ]
|
||||
Reference in New Issue
Block a user